mirror of
https://github.com/lexi-lambda/freer-simple.git
synced 2024-12-25 07:02:20 +03:00
Merge branch 'topic/remove_asks' into 'master'
Remove asks from examples. See merge request !6
This commit is contained in:
commit
ba71d26a16
@ -82,9 +82,6 @@ with 'runReader', how to access the Reader data with 'ask' and 'asks'.
|
|||||||
>
|
>
|
||||||
>type Bindings = Map String Int
|
>type Bindings = Map String Int
|
||||||
>
|
>
|
||||||
>asks :: (b -> a) -> Eff '[Reader b] a
|
|
||||||
>asks f = ask >>= return . f
|
|
||||||
>
|
|
||||||
>-- Returns True if the "count" variable contains correct bindings size.
|
>-- Returns True if the "count" variable contains correct bindings size.
|
||||||
>isCountCorrect :: Bindings -> Bool
|
>isCountCorrect :: Bindings -> Bool
|
||||||
>isCountCorrect bindings = run $ runReader calc_isCountCorrect bindings
|
>isCountCorrect bindings = run $ runReader calc_isCountCorrect bindings
|
||||||
@ -121,9 +118,6 @@ Shows how to modify Reader content with 'local'.
|
|||||||
>
|
>
|
||||||
> type Bindings = Map String Int
|
> type Bindings = Map String Int
|
||||||
>
|
>
|
||||||
> asks :: (b -> a) -> Eff '[Reader b] a
|
|
||||||
> asks f = ask >>= return . f
|
|
||||||
>
|
|
||||||
> calculateContentLen :: Eff '[Reader String] Int
|
> calculateContentLen :: Eff '[Reader String] Int
|
||||||
> calculateContentLen = do
|
> calculateContentLen = do
|
||||||
> content <- (ask :: Eff '[Reader String] String)
|
> content <- (ask :: Eff '[Reader String] String)
|
||||||
|
Loading…
Reference in New Issue
Block a user