fork download
  1. (?) p = \x -> if p x then Left x else Right x
  2. p --> (f,g) = either f g . (p?)
  3. (!) x = \_ -> x
  4.  
  5. maybeHead = null --> ((Nothing!), Just . head)
  6.  
  7. main = do print $ maybeHead ([]::[Int])
  8. print $ maybeHead [1,2]
Success #stdin #stdout 0s 6224KB
stdin
Standard input is empty
stdout
Nothing
Just 1