iterIO error

1
2
3
4
5
6
7
Data/IterIO/SSL.hs:36:39:
    Couldn't match expected type `Net.Socket'
                with actual type `Maybe Net.Socket'
    In the return type of a call of `SSL.sslSocket'
    In the second argument of `($)', namely `SSL.sslSocket ssl'
    In the second argument of `consCtl', namely
      `(socketCtl $ SSL.sslSocket ssl)'

iterIO error (annotation)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- Simple fix to get IterIO to work Change made in SSL.hs to enumSs fucntion


-- | Simple OpenSSL 'Onum'.
enumSsl :: (MonadIO m) => SSL.SSL -> Onum L.ByteString m a
enumSsl ssl = mkInumC id ch codec
    where ch = mkCtl (\SslC -> return $ SslConnection ssl)
               `consCtl` (socketCtl $ case (SSL.sslSocket ssl) of
                                        Just x -> x
                                        Nothing -> error "error unwraping maybe")
          codec = do buf <- liftIO (SSL.read ssl L.defaultChunkSize)
                     if S.null buf
                       then return L.empty
                       else return $ L.fromChunks [buf]
7:16: Warning: Redundant $
Found:
mkCtl (\ SslC -> return $ SslConnection ssl) `consCtl`
(socketCtl $
case (SSL.sslSocket ssl) of
Just x -> x
Nothing -> error "error unwraping maybe")
Why not:
mkCtl (\ SslC -> return $ SslConnection ssl) `consCtl`
socketCtl
(case (SSL.sslSocket ssl) of
Just x -> x
Nothing -> error "error unwraping maybe")
8:39: Warning: Use fromMaybe
Found:
case (SSL.sslSocket ssl) of
Just x -> x
Nothing -> error "error unwraping maybe"
Why not:
fromMaybe (error "error unwraping maybe") (SSL.sslSocket ssl)
8:39: Warning: Redundant bracket
Found:
case (SSL.sslSocket ssl) of
Just x -> x
Nothing -> error "error unwraping maybe"
Why not:
case SSL.sslSocket ssl of
Just x -> x
Nothing -> error "error unwraping maybe"

iterIO error (annotation) (annotation)

1
2
3
4
5
6
7
8
9
10
11
12
-- Simple fix to get IterIO to work Change made in SSL.hs to enumSs fucntion


-- | Simple OpenSSL 'Onum'.
enumSsl :: (MonadIO m) => SSL.SSL -> Onum L.ByteString m a
enumSsl ssl = mkInumC id ch codec
    where ch = mkCtl (\SslC -> return $ SslConnection ssl)
               `consCtl` (socketCtl $ fromMaybe (error "error unwraping maybe") (SSL.sslSocket ssl))
          codec = do buf <- liftIO (SSL.read ssl L.defaultChunkSize)
                     if S.null buf
                       then return L.empty
                       else return $ L.fromChunks [buf]
7:16: Warning: Redundant $
Found:
mkCtl (\ SslC -> return $ SslConnection ssl) `consCtl`
(socketCtl $
fromMaybe (error "error unwraping maybe") (SSL.sslSocket ssl))
Why not:
mkCtl (\ SslC -> return $ SslConnection ssl) `consCtl`
socketCtl
(fromMaybe (error "error unwraping maybe") (SSL.sslSocket ssl))