Solve task 03
This commit is contained in:
parent
37ba1cb36d
commit
7676005844
2 changed files with 9 additions and 5 deletions
4
.vscode/tasks.json
vendored
Normal file
4
.vscode/tasks.json
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
{
|
||||
"version": "2.0.0"
|
||||
}
|
|
@ -57,7 +57,7 @@ Greet Obi-Wan and Han, each with a phrase like e.g.
|
|||
"Hello Obi-Wan". Use 'map' and 'first'.
|
||||
-}
|
||||
greetings :: [String]
|
||||
greetings = error "fixme"
|
||||
greetings = map (\x -> "Hello " ++ firstName x) [han, obiWan]
|
||||
|
||||
{- "Setters"
|
||||
Values of a record can be changed with the syntax below.
|
||||
|
@ -125,10 +125,10 @@ data MyList a
|
|||
[1,2,3] as 'MyList'
|
||||
-}
|
||||
list :: MyList Integer
|
||||
list =
|
||||
list =
|
||||
Cons
|
||||
1
|
||||
(Cons
|
||||
(Cons
|
||||
2
|
||||
(Cons
|
||||
3
|
||||
|
@ -142,8 +142,8 @@ list =
|
|||
-}
|
||||
data Shape
|
||||
= Circle { radius :: Float }
|
||||
| Rectangle
|
||||
| Rectangle
|
||||
{ len :: Float
|
||||
, width :: Float
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue