Add decidably empty things
commitc99f2d2c5426df68a02ac2dbc8755afa35dd907e
authorJohn Ericson <git@JohnEricson.me>
dateSat 11 Jan 2020, 19:26 (7 years ago)
parentab5bd5d
patch.cabal+3−1
@@ -39,7 +39,9 @@ library
3939 , transformers >= 0.5.6.0 && < 0.6
4040 , witherable >= 0.3 && < 0.3.2
4141
42− exposed-modules: Data.Functor.Misc
42+ exposed-modules: Control.Category.DecidablyEmpty
43+ , Data.Functor.Misc
44+ , Data.Monoid.DecidablyEmpty
4345 , Data.Patch
4446 , Data.Patch.Class
4547 , Data.Patch.DMap
src/Control/Category/DecidablyEmpty.hsnew file+9
@@ -0,0 +1,9 @@
1+{-# LANGUAGE TypeOperators #-}
2+-- TODO upstream somwhere else?
3+module Control.Category.DecidablyEmpty where
4+
5+import Control.Category
6+import Data.Type.Equality
7+
8+class Category c => DecidablyEmpty c where
9+ isId :: c a b -> Maybe (a :~: b)