Skip to content

Commit

Permalink
Merge pull request #33 from jmorag/ismember-fundep
Browse files Browse the repository at this point in the history
Add functional dependency to IsMember for better type inference
  • Loading branch information
dorchard authored Dec 19, 2023
2 parents b340c82 + 01ce6b0 commit 8e6a203
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Data/Type/Map.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The implementation is similar to that shown in the paper.
{-# LANGUAGE TypeOperators, PolyKinds, DataKinds, KindSignatures,
TypeFamilies, UndecidableInstances, MultiParamTypeClasses,
FlexibleInstances, GADTs, FlexibleContexts, ScopedTypeVariables,
ConstraintKinds, IncoherentInstances #-}
ConstraintKinds, IncoherentInstances, FunctionalDependencies #-}

module Data.Type.Map (Mapping(..), Union, Unionable, union, append, Var(..), Map(..),
ext, empty, mapLength,
Expand Down Expand Up @@ -92,7 +92,7 @@ mapLength Empty = 0
mapLength (Ext _ _ xs) = 1 + mapLength xs

{-| Membership test a type class (predicate) -}
class IsMember v t m where
class IsMember v t m | m v -> t where
{-| Value-level lookup of elements from a map, via type class predicate -}
lookp :: Var v -> Map m -> t

Expand Down

0 comments on commit 8e6a203

Please sign in to comment.