Commit 08a648dc authored by Hans-Peter Deifel's avatar Hans-Peter Deifel 🐢

Document Desorting module

The `Desorted` type had me confused everytime I looked at it, so now
it's (hopefully) a bit more clear.
parent 8aa59040
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE Strict #-}
{-# LANGUAGE CPP #-}
-- | Desorting is what we call the process of transforming coalgebras for
-- \(F·G\) into coalgebras for \(F+G\). See also [1, Section 8] and
-- [2, Section 3.5]
--
-- The sum type \(F+G\) is implemented jointly by `SomeFunctor` (which takes care
-- of Haskell's type system) and `Desorted`, which allows to distinguish between
-- states for the same functor but of different sorts.
--
-- (1) Wißmann, T., Dorsch, U., Milius, S., & Schröder, L. (2020). Efficient and
-- Modular Coalgebraic Partition Refinement. Logical Methods in Computer Science,
-- Volume 16, Issue 1, . http://dx.doi.org/10.23638/LMCS-16(1:8)2020
--
-- (2) Wißmann, T., Deifel, H., Milius, S., & Schröder, L. (2020). From generic
-- partition refinement to weighted tree automata minimization.
-- https://arxiv.org/abs/2004.01250
module Copar.FunctorExpression.Desorting
( Desorted
, Sorted(..)
, desort
, desortedLabel
, mkDesortedLabel
, mapDesortedLabel
......@@ -12,16 +27,14 @@ module Copar.FunctorExpression.Desorting
import Prelude hiding (init)
import Copar.FunctorExpression.Type
import Copar.FunctorExpression.Sorts
import Copar.RefinementInterface
import Copar.Functors.SomeFunctor
data Desorted f a = Desorted (FunctorExpression f Sort) a
deriving (Functor, Foldable, Traversable, Show)
desort :: FunctorExpression f Sort -> Desorted f ()
desort expr = Desorted expr ()
-- | This type is never instantiated and exists solely to implement the
-- refinement interface and its associated types.
data Desorted (f :: * -> *) a
deriving (Functor, Foldable, Traversable)
type instance F1 (Desorted f) = Sorted (F1 f)
#ifdef RELEASE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment