Skip to content
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

Upgrade dependencies for PureScript 0.15.9 #4

Merged
merged 2 commits into from
Jun 26, 2023
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
9 changes: 4 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
"output"
],
"dependencies": {
"purescript-transformers": "^3.4.0",
"purescript-bifunctors": "^3.0.0",
"purescript-foldable-traversable": "^3.3.1",
"purescript-maybe": "^3.0.0",
"purescript-generics": "^4.0.0"
"purescript-transformers": "^6.0.0",
"purescript-bifunctors": "^6.0.0",
"purescript-foldable-traversable": "^6.0.0",
"purescript-maybe": "^6.0.0"
}
}
43 changes: 23 additions & 20 deletions src/Bound.purs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ import Control.Monad.Writer (WriterT)
import Data.Bifunctor (class Bifunctor, bimap)
import Data.Bifoldable (class Bifoldable, bifoldMap, bifoldrDefault, bifoldlDefault)
import Data.Bitraversable (class Bitraversable, bitraverse, bisequenceDefault)
import Data.Eq (class Eq1)
import Data.Foldable (class Foldable, foldMap, foldrDefault, foldlDefault)
import Data.Generic (class Generic, gShow)
import Data.Generic.Rep (class Generic)
import Data.Ord (class Ord1)
import Data.Show.Generic (genericShow)
import Data.Traversable (class Traversable, traverse, sequenceDefault)
import Data.Maybe (Maybe(..))
import Data.Monoid (class Monoid, mempty)
import Prelude


Expand Down Expand Up @@ -84,11 +86,11 @@ instance boundWriterT :: Monoid w => Bound (WriterT w) where

data Var b a = B b | F a

derive instance genericVar :: (Generic b, Generic a) => Generic (Var b a)
derive instance genericVar :: Generic (Var b a) _
derive instance eqVar :: (Eq b, Eq a) => Eq (Var b a)
derive instance ordVar :: (Ord b, Ord a) => Ord (Var b a)
instance showVar :: (Generic b, Generic a) => Show (Var b a) where
show = gShow
instance showVar :: (Show b, Show a) => Show (Var b a) where
show = genericShow

instance functorVar :: Functor (Var b) where
map = liftA1
Expand All @@ -97,31 +99,31 @@ instance applyVar :: Apply (Var b) where
instance applicativeVar :: Applicative (Var b) where
pure = F
instance bindVar :: Bind (Var b) where
bind (B x) f = B x
bind (B x) _f = B x
bind (F y) f = f y
instance monadVar :: Monad (Var b)

instance foldableVar :: Foldable (Var b) where
foldMap f (B x) = mempty
foldMap _f (B _x) = mempty
foldMap f (F y) = f y
foldr f = foldrDefault f
foldl f = foldlDefault f
instance traversableVar :: Traversable (Var b) where
traverse f (B x) = pure (B x)
traverse _f (B x) = pure (B x)
traverse f (F y) = F <$> f y
sequence x = sequenceDefault x

instance bifunctorVar :: Bifunctor Var where
bimap f g (B x) = B (f x)
bimap f g (F y) = F (g y)
bimap f _g (B x) = B (f x)
bimap _f g (F y) = F (g y)
instance bifoldableVar :: Bifoldable Var where
bifoldMap f g (B x) = f x
bifoldMap f g (F y) = g y
bifoldMap f _g (B x) = f x
bifoldMap _f g (F y) = g y
bifoldr f = bifoldrDefault f
bifoldl f = bifoldlDefault f
instance bitraversableVar :: Bitraversable Var where
bitraverse f g (B x) = B <$> f x
bitraverse f g (F y) = F <$> g y
bitraverse f _g (B x) = B <$> f x
bitraverse _f g (F y) = F <$> g y
bisequence x = bisequenceDefault x


Expand All @@ -139,11 +141,11 @@ fromScope scope = do
toScope :: forall b f a. Monad f => f (Var b a) -> Scope b f a
toScope = Scope <<< map (map pure)

derive instance genericScope :: (Generic b, Generic (f (Var b (f a))), Generic a) => Generic (Scope b f a)
derive instance eqScope :: (Eq b, Eq (f (Var b (f a))), Eq a) => Eq (Scope b f a)
derive instance ordScope :: (Ord b, Ord (f (Var b (f a))), Ord a) => Ord (Scope b f a)
instance showScope :: (Generic b, Generic (f (Var b (f a))), Generic a) => Show (Scope b f a) where
show = gShow
derive instance genericScope :: Generic (Scope b f a) _
derive instance eqScope :: (Eq b, Eq1 f, Eq (f a), Eq (f (Var b (f a))), Eq a) => Eq (Scope b f a)
derive instance ordScope :: (Ord b, Ord1 f, Ord (f a), Ord (f (Var b (f a))), Ord a) => Ord (Scope b f a)
instance showScope :: (Show b, Show (f (Var b (f a))), Show a) => Show (Scope b f a) where
show = genericShow

instance functorScope :: Functor f => Functor (Scope b f) where
map f = Scope <<< map (map (map f)) <<< unScope
Expand Down Expand Up @@ -204,7 +206,7 @@ bindings = foldMap f <<< unScope
f _ = []

mapBound :: forall a b c f. Functor f => (b -> c) -> Scope b f a -> Scope c f a
mapBound f = mapScope f id
mapBound f = mapScope f identity

mapScope :: forall a b c d f. Functor f => (b -> d) -> (a -> c) -> Scope b f a -> Scope d f c
mapScope f g = Scope <<< map (bimap f (map g)) <<< unScope
Expand All @@ -221,6 +223,7 @@ traverseBound f = traverseScope f pure
traverseScope :: forall a b c d f m. Traversable f => Applicative m => (b -> m d) -> (a -> m c) -> Scope b f a -> m (Scope d f c)
traverseScope f g = map Scope <<< traverse (bitraverse f (traverse g)) <<< unScope

newtype AM :: (Type -> Type) -> Type -> Type
newtype AM f a = AM (f a) -- for "Applicative Monoid"
getAM :: forall f a. AM f a -> f a
getAM (AM x) = x
Expand Down