elm-explorations / elm-explorations/test

Example of Shrink.map usage does not type

Open
#101 0 comments 1 reaction 0 assignees View on GitHub
docs
Dominant language
Elm
Stars
244
Forks
40
Avg merge
1d 23h
Merged PRs (30d)
2

Description

The signatures for `map` and `andMap` are

```
map : (a -> b) -> LazyList a -> LazyList b
andMap : LazyList a -> LazyList (a -> b) -> LazyList b
```

and the example shows them used as

```
type alias Vector =
{ x : Float
, y : Float
, z : Float
}

vector : Shrinker Vector
vector { x, y, z } =
Vector
|> map (float x)
|> andMap (float y)
|> andMap (float z)
```

So `map` is getting a `LazyList Float` as it's first argument and a `Float -> Float -> Float -> Vector` function as the second one. That's the revers of what the signature says.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.