tock-mirror/frontends/UnifyType.hs
Neil Brown 8f767ff0d4 Made all the imports of Data.Generics have an import list
This makes sure that we catch all leftover instances of using SYB to do generic operations that we should be using Polyplate for instead.  Most modules should only import Data, and possibly Typeable.
2009-04-09 15:36:37 +00:00

37 lines
1.1 KiB
Haskell

{-
Tock: a compiler for parallel languages
Copyright (C) 2008 University of Kent
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
-}
module UnifyType where
import Data.Generics (Data, Typeable)
import Data.IORef
import qualified AST as A
import Metadata
type Ptr a = IORef (A.TypeRequirements, Maybe (TypeExp a))
data Typeable a => TypeExp a
= MutVar Meta (Ptr a)
| GenVar Meta Int
-- Either a list of integers that must fit, or a concrete type
| NumLit Meta (IORef (Either [(Meta, Integer)] A.Type))
| OperType Meta String ([A.Type] -> A.Type) [ TypeExp a ]
deriving (Typeable, Data)