{- Copyright (c) 2013, Alex Cole This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE QuasiQuotes #-} module Data.Types.Reorder ( module Data.Types.Reorder.Base, module Data.Types.Reorder.Product, module Data.Types.Reorder.Sum, reorderableGroup, debugProductType, reorderable, reorderer ) where -- Core type classes on which the reorderable types are based. import Data.Types.Reorder.Base -- Generate the instances for all reorderable types to interact with our -- sentinel type. import Data.Types.Reorder.Quoter -- Generate code for creating sum and product types. import Data.Types.Reorder.Sum import Data.Types.Reorder.Product -- The code tha actually declares a new type as usable in a reorderable -- container. import Data.Types.Reorder.TH (reorderable, reorderableGroup) -- Show, Read, and Eq instances for Product and Sum types. import Data.Types.Reorder.Instances class ReorderableEndDone a [reorderer|ReorderableEndDone -- Two things the same are always the same. type instance TypeOrder ??? ??? = TypeOrder_Same -- "ReorderableEnd" always comes after everything else - that is the nature -- of an "End". Were this not stated as a special case, it would result in -- this type being ordered alphabetically instead. type instance TypeOrder ReorderableEnd ??? = TypeOrder_Lower type instance TypeOrder ??? ReorderableEnd = TypeOrder_Higher |]