Skip to content

Commit 576b902

Browse files
fixup! jun3/haskell: fix questions and add some new
1 parent 073d64a commit 576b902

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

backend/junior-3/haskell.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@
202202
* `\x -> x * 2`
203203
* `(\x -> x + 1) 3`
204204
* Can haskell evaluate in strict mode?
205+
* Why are values in Haskell typically (when using bang patterns, `Strict`,
206+
`seq`, `foldl'`, `modifyIORef'` etc) calculated to WHNF, not to NF?
205207
* What is the function `seq` (and operator `$!`)?
206208
* What is the function `deepseq` (and operator `$!!`)?
207209
* Could using `seq` change the returned value of the function?
@@ -225,15 +227,15 @@
225227
```
226228

227229
* Do bang patterns force execution when they are nested in constructors inside
228-
`let` or `where` expressions? Does this force `a` to be evaluated and when
230+
`let` or `where` expressions? Does this force `a` to be evaluated or when
229231
it does?
230232

231233
```haskell
232234
let (Just !a) = x in 1 + 1
235+
let (Just !a) = x in [a]
233236
```
234237

235238
* What are the GHC extensions `Strict` and `StrictData`?
236-
* What form do Haskell functions calculate values to with `Strict` extension enabled? Why not to another form?
237239

238240
#### Resources
239241

0 commit comments

Comments
 (0)