Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit a5151d3

Browse files
committed
Derive Eq, Ord, & Show instances for Polytype.
1 parent fcfc816 commit a5151d3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

semantic-core/src/Analysis/Typecheck.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# LANGUAGE DeriveGeneric, DeriveTraversable, FlexibleContexts, FlexibleInstances, LambdaCase, OverloadedStrings, RecordWildCards, ScopedTypeVariables, TypeApplications #-}
1+
{-# LANGUAGE DeriveGeneric, DeriveTraversable, FlexibleContexts, FlexibleInstances, LambdaCase, OverloadedStrings, QuantifiedConstraints, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TypeApplications #-}
22
module Analysis.Typecheck
33
( Monotype (..)
44
, Meta
@@ -56,6 +56,11 @@ data Polytype f a
5656
| PRecord (Map.Map User (f a))
5757
deriving (Foldable, Functor, Generic1, Traversable)
5858

59+
deriving instance (Eq a, forall a . Eq a => Eq (f a), Monad f) => Eq (Polytype f a)
60+
deriving instance (Ord a, forall a . Eq a => Eq (f a)
61+
, forall a . Ord a => Ord (f a), Monad f) => Ord (Polytype f a)
62+
deriving instance (Show a, forall a . Show a => Show (f a)) => Show (Polytype f a)
63+
5964
instance HFunctor Polytype
6065
instance RightModule Polytype where
6166
PForAll b >>=* f = PForAll (b >>=* f)

0 commit comments

Comments
 (0)