Skip to content

Add Debug instances #32

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

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Notable changes to this project are documented in this file. The format is based
Breaking changes:

New features:
- Add `Debug` instances (#32 by @JordanMartinez)

Bugfixes:

Expand Down
6 changes: 6 additions & 0 deletions src/Effect.purs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ module Effect

import Prelude

import Data.Debug (class Debug)
import Data.Debug.Type as D

import Control.Apply (lift2)

-- | A native effect. The type parameter denotes the return type of running the
Expand All @@ -17,6 +20,9 @@ foreign import data Effect :: Type -> Type

type role Effect representational

instance Debug (Effect a) where
debug _ = D.opaque_ "Effect"

instance functorEffect :: Functor Effect where
map = liftA1

Expand Down
32 changes: 32 additions & 0 deletions src/Effect/Uncurried.purs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@

module Effect.Uncurried where

import Data.Debug (class Debug)
import Data.Debug.Type as D
import Data.Monoid (class Monoid, class Semigroup, mempty, (<>))
import Effect (Effect)

Expand Down Expand Up @@ -284,3 +286,33 @@ instance monoidEffectFn9 :: Monoid r => Monoid (EffectFn9 a b c d e f g h i r) w

instance monoidEffectFn10 :: Monoid r => Monoid (EffectFn10 a b c d e f g h i j r) where
mempty = mkEffectFn10 \_ _ _ _ _ _ _ _ _ _ -> mempty

instance Debug (EffectFn1 a r) where
debug _ = D.opaque_ "EffectFn1"

instance Debug (EffectFn10 a b r) where
debug _ = D.opaque_ "EffectFn2"

instance Debug (EffectFn10 a b c r) where
debug _ = D.opaque_ "EffectFn3"

instance Debug (EffectFn10 a b c d r) where
debug _ = D.opaque_ "EffectFn4"

instance Debug (EffectFn10 a b c d e r) where
debug _ = D.opaque_ "EffectFn5"

instance Debug (EffectFn10 a b c d e f r) where
debug _ = D.opaque_ "EffectFn6"

instance Debug (EffectFn10 a b c d e f g r) where
debug _ = D.opaque_ "EffectFn7"

instance Debug (EffectFn10 a b c d e f g h r) where
debug _ = D.opaque_ "EffectFn8"

instance Debug (EffectFn10 a b c d e f g h i r) where
debug _ = D.opaque_ "EffectFn9"

instance Debug (EffectFn10 a b c d e f g h i j r) where
debug _ = D.opaque_ "EffectFn10"