Skip to content

Add roles declarations to allow safe coercions #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Effect.purs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import Control.Apply (lift2)
-- | eventually produces a value of the type `Int` when it finishes.
foreign import data Effect :: Type -> Type

type role Effect representational

instance functorEffect :: Functor Effect where
map = liftA1

Expand Down
29 changes: 29 additions & 0 deletions src/Effect/Uncurried.purs
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,45 @@ import Data.Monoid (class Monoid, class Semigroup, mempty, (<>))
import Effect (Effect)

foreign import data EffectFn1 :: Type -> Type -> Type

type role EffectFn1 representational representational

foreign import data EffectFn2 :: Type -> Type -> Type -> Type

type role EffectFn2 representational representational representational

foreign import data EffectFn3 :: Type -> Type -> Type -> Type -> Type

type role EffectFn3 representational representational representational representational

foreign import data EffectFn4 :: Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn4 representational representational representational representational representational

foreign import data EffectFn5 :: Type -> Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn5 representational representational representational representational representational representational

foreign import data EffectFn6 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn6 representational representational representational representational representational representational representational

foreign import data EffectFn7 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn7 representational representational representational representational representational representational representational representational

foreign import data EffectFn8 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn8 representational representational representational representational representational representational representational representational representational

foreign import data EffectFn9 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn9 representational representational representational representational representational representational representational representational representational representational

foreign import data EffectFn10 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn10 representational representational representational representational representational representational representational representational representational representational representational

foreign import mkEffectFn1 :: forall a r.
(a -> Effect r) -> EffectFn1 a r
foreign import mkEffectFn2 :: forall a b r.
Expand Down