Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
2
Task/Inverted-syntax/Haskell/inverted-syntax-1.hs
Normal file
2
Task/Inverted-syntax/Haskell/inverted-syntax-1.hs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
when :: Monad m => m () -> Bool -> m ()
|
||||
action `when` condition = if condition then action else return ()
|
||||
2
Task/Inverted-syntax/Haskell/inverted-syntax-2.hs
Normal file
2
Task/Inverted-syntax/Haskell/inverted-syntax-2.hs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
func a b x = (x + y) / y
|
||||
where y = a * b
|
||||
3
Task/Inverted-syntax/Haskell/inverted-syntax-3.hs
Normal file
3
Task/Inverted-syntax/Haskell/inverted-syntax-3.hs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
func a b x =
|
||||
let y = a * b in
|
||||
(x + y) / y
|
||||
16
Task/Inverted-syntax/Haskell/inverted-syntax-4.hs
Normal file
16
Task/Inverted-syntax/Haskell/inverted-syntax-4.hs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import Data.Bool (bool)
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
let raining = False
|
||||
|
||||
putStrLn $ bool "No need" "UMBRELLA !" raining
|
||||
putStrLn $ flip bool "No need" "UMBRELLA !" raining
|
||||
|
||||
putStrLn "\n--------\n"
|
||||
|
||||
mapM_ putStrLn $
|
||||
[bool, flip bool]
|
||||
<*> ["No need"]
|
||||
<*> ["UMBRELLA !"]
|
||||
<*> [raining, not raining]
|
||||
Loading…
Add table
Add a link
Reference in a new issue