Add a trivial "parmap" implementation to the reference interpreter.

This commit is contained in:
Rob Dockins 2020-07-02 15:24:57 -07:00
parent 7b0f69de28
commit 0d7d98bcfb
2 changed files with 10 additions and 0 deletions

Binary file not shown.

View File

@ -804,6 +804,16 @@ by corresponding typeclasses
> diff = y - x)
>
> -- Miscellaneous:
> , ("parmap" , VPoly $ \_a ->
> VPoly $ \_b ->
> VNumPoly $ \n ->
> VFun $ \f ->
> VFun $ \xs ->
> -- Note: the reference implementation simply
> -- executes parmap sequentially
> let xs' = map (fromVFun f) (fromVList xs) in
> VList n xs')
>
> , ("error" , VPoly $ \a ->
> VNumPoly $ \_ ->
> VFun $ \_s -> cryError (UserError "error") a)