tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
3
Task/Null-object/Haskell/null-object-1.hs
Normal file
3
Task/Null-object/Haskell/null-object-1.hs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
undefined -- undefined value provided by the standard library
|
||||
error "oops" -- another undefined value
|
||||
head [] -- undefined, you can't take the head of an empty list
|
||||
1
Task/Null-object/Haskell/null-object-2.hs
Normal file
1
Task/Null-object/Haskell/null-object-2.hs
Normal file
|
|
@ -0,0 +1 @@
|
|||
data Maybe a = Nothing | Just a
|
||||
3
Task/Null-object/Haskell/null-object-3.hs
Normal file
3
Task/Null-object/Haskell/null-object-3.hs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
case thing of
|
||||
Nothing -> "It's Nothing. Or null, whatever."
|
||||
Just v -> "It's not Nothing; it is " ++ show v ++ "."
|
||||
Loading…
Add table
Add a link
Reference in a new issue