about summary refs log tree commit diff
path: root/third_party/bazel/rules_haskell/tests/binary-with-import/src/Lib.hs
blob: d384e73e6337a5cbea082928b45bc3f6f3c4a1cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
module Lib (printValue) where

import Control.Monad (void)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Except (ExceptT, runExceptT)

getValue :: Monad m => ExceptT e m Int
getValue = pure 42

printValue :: IO ()
printValue = void $ runExceptT $ do
  value <- getValue
  lift $ print value