Skip to content

Instantly share code, notes, and snippets.

@ThoNohT
Created November 29, 2021 16:46
Show Gist options
  • Save ThoNohT/95f24e1437593baceb6c624e7fb63721 to your computer and use it in GitHub Desktop.
Save ThoNohT/95f24e1437593baceb6c624e7fb63721 to your computer and use it in GitHub Desktop.
boolToString :: Bool -> String
boolToString True = "TRUE"
boolToString False = "FALSE"
assertString :: Eq a => a -> a -> Bool
assertString a b = a == b
infixr 8 |.|
(|.|) :: (b -> c) -> (a -> a' -> b) -> a -> a' -> c
(|.|) f g = \x y -> f (g x y)
printResult :: Eq a => a -> a -> IO ()
printResult = putStrLn . boolToString |.| assertString
main = do
printResult 1 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment