Skip to content

Commit 58f8707

Browse files
committed
Merge pull request #9 from rightfold/master
Use newtype where possible
2 parents e958ccd + 45099c6 commit 58f8707

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/Data/Bifunctor/Clown.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Data.Bifunctor (class Bifunctor)
1010
import Data.Functor (class Functor, map)
1111

1212
-- | Make a `Functor` over the first argument of a `Bifunctor`
13-
data Clown f a b = Clown (f a)
13+
newtype Clown f a b = Clown (f a)
1414

1515
-- | Remove the `Clown` constructor.
1616
runClown :: forall f a b. Clown f a b -> f a

src/Data/Bifunctor/Flip.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Data.Bifunctor (class Bifunctor, bimap, lmap)
88
import Data.Functor (class Functor)
99

1010
-- | Flips the order of the type arguments of a `Bifunctor`.
11-
data Flip p a b = Flip (p b a)
11+
newtype Flip p a b = Flip (p b a)
1212

1313
-- | Remove the `Flip` constructor.
1414
runFlip :: forall p a b. Flip p a b -> p b a

src/Data/Bifunctor/Join.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Data.Bifunctor (class Bifunctor, bimap)
1010
import Data.Functor (class Functor, (<$>))
1111

1212
-- | Turns a `Bifunctor` into a `Functor` by equating the two type arguments.
13-
data Join p a = Join (p a a)
13+
newtype Join p a = Join (p a a)
1414

1515
-- | Remove the `Join` constructor.
1616
runJoin :: forall p a. Join p a -> p a a

src/Data/Bifunctor/Joker.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Data.Bifunctor (class Bifunctor)
1010
import Data.Functor (class Functor, map)
1111

1212
-- | Make a `Functor` over the second argument of a `Bifunctor`
13-
data Joker g a b = Joker (g b)
13+
newtype Joker g a b = Joker (g b)
1414

1515
-- | Remove the `Joker` constructor.
1616
runJoker :: forall g a b. Joker g a b -> g b

src/Data/Bifunctor/Wrap.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Data.Bifunctor (class Bifunctor, bimap, rmap)
88
import Data.Functor (class Functor)
99

1010
-- | Provides a `Functor` over the second argument of a `Bifunctor`.
11-
data Wrap p a b = Wrap (p a b)
11+
newtype Wrap p a b = Wrap (p a b)
1212

1313
-- | Remove the `Wrap` constructor.
1414
unwrap :: forall p a b. Wrap p a b -> p a b

0 commit comments

Comments
 (0)