1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Domain is scope-safe.

This commit is contained in:
Rob Rix 2019-11-04 14:35:24 -05:00
parent 40d3e5ece6
commit 24f6159acc
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -1,13 +1,19 @@
{-# LANGUAGE QuantifiedConstraints, StandaloneDeriving #-}
module Analysis.Domain
( Domain(..)
) where
import Data.Text (Text)
import Syntax.Scope
data Domain name a
data Domain name f a
= Unit
| Bool Bool
| String Text
| Record [(name, a)]
| Lam name a
deriving (Eq, Ord, Show)
| Record [(name, f a)]
| Lam name (Scope () f a)
deriving instance (Eq name, Eq a, forall a . Eq a => Eq (f a), Monad f) => Eq (Domain name f a)
deriving instance (Ord name, Ord a, forall a . Eq a => Eq (f a)
, forall a . Ord a => Ord (f a), Monad f) => Ord (Domain name f a)
deriving instance (Show name, Show a, forall a . Show a => Show (f a)) => Show (Domain name f a)