Skip to content

Commit

Permalink
Stylish Haskell changes
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Oct 26, 2020
1 parent 7548018 commit 840eeaf
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
7 changes: 4 additions & 3 deletions examples/acceptor/Main.hs
Expand Up @@ -17,9 +17,10 @@ import qualified Cardano.BM.Tracing as Trace
import qualified Options.Applicative as Opt


data CLI = CLI
{ cConfig :: FilePath
}
data CLI
= CLI
{ cConfig :: FilePath
}

cliParser :: Opt.Parser CLI
cliParser = CLI
Expand Down
31 changes: 16 additions & 15 deletions iohk-monitoring/src/Cardano/BM/Snocket.hs
Expand Up @@ -162,21 +162,22 @@ instance Show (AddressFamily addr) where
-- 'Socket'. Snockets are polymorphic over monad which is used, this feature
-- is useful for testing and/or simulations.
--
data Snocket m fd addr = Snocket
{ getLocalAddr :: fd -> m addr
, getRemoteAddr :: fd -> m addr
, addrFamily :: addr -> AddressFamily addr
, open :: AddressFamily addr -> m fd
-- |^ Open a file descriptor: socket='socket', namedPipe='CreateNamedPipe'
, openToConnect :: addr -> m fd
-- |^ A way to create 'fd' to pass to 'connect'. For named pipes it uses 'CreateFile'
, connect :: fd -> addr -> m ()
-- |^ `connect` is only needed for Berkeley sockets, for named pipes this is a no-op.
, bind :: fd -> addr -> m ()
, listen :: fd -> m ()
, accept :: fd -> Accept addr fd
, close :: fd -> m ()
}
data Snocket m fd addr
= Snocket
{ getLocalAddr :: fd -> m addr
, getRemoteAddr :: fd -> m addr
, addrFamily :: addr -> AddressFamily addr
, open :: AddressFamily addr -> m fd
-- |^ Open a file descriptor: socket='socket', namedPipe='CreateNamedPipe'
, openToConnect :: addr -> m fd
-- |^ A way to create 'fd' to pass to 'connect'. For named pipes it uses 'CreateFile'
, connect :: fd -> addr -> m ()
-- |^ `connect` is only needed for Berkeley sockets, for named pipes this is a no-op.
, bind :: fd -> addr -> m ()
, listen :: fd -> m ()
, accept :: fd -> Accept addr fd
, close :: fd -> m ()
}


--
Expand Down
11 changes: 6 additions & 5 deletions tracer-transformers/example2/Main.hs
Expand Up @@ -109,11 +109,12 @@ data BlockActions = BlockAction1
data Timing = Timing Int
deriving (Show)

data MyCodeTracers m = MyCodeTracers
{ tr1 :: Tracer m (MyMessages BlockActions)
, tr2 :: Tracer m (MyMessages Timing)
-- and so forth
}
data MyCodeTracers m
= MyCodeTracers
{ tr1 :: Tracer m (MyMessages BlockActions)
, tr2 :: Tracer m (MyMessages Timing)
-- and so forth
}

myCodeTracersBenchmarking = MyCodeTracers
{ tr1 = nullTracer
Expand Down

0 comments on commit 840eeaf

Please sign in to comment.