1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Derive Eq, Ord, & Show instances for Polytype.

This commit is contained in:
Rob Rix 2019-07-18 15:31:53 -04:00
parent fcfc81606a
commit a5151d34e1
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DeriveGeneric, DeriveTraversable, FlexibleContexts, FlexibleInstances, LambdaCase, OverloadedStrings, RecordWildCards, ScopedTypeVariables, TypeApplications #-}
{-# LANGUAGE DeriveGeneric, DeriveTraversable, FlexibleContexts, FlexibleInstances, LambdaCase, OverloadedStrings, QuantifiedConstraints, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TypeApplications #-}
module Analysis.Typecheck
( Monotype (..)
, Meta
@ -56,6 +56,11 @@ data Polytype f a
| PRecord (Map.Map User (f a))
deriving (Foldable, Functor, Generic1, Traversable)
deriving instance (Eq a, forall a . Eq a => Eq (f a), Monad f) => Eq (Polytype f a)
deriving instance (Ord a, forall a . Eq a => Eq (f a)
, forall a . Ord a => Ord (f a), Monad f) => Ord (Polytype f a)
deriving instance (Show a, forall a . Show a => Show (f a)) => Show (Polytype f a)
instance HFunctor Polytype
instance RightModule Polytype where
PForAll b >>=* f = PForAll (b >>=* f)