Changeset 12198 for src/Pugs/Val
- Timestamp:
- 08/14/06 06:31:33 (2 years ago)
- Location:
- src/Pugs/Val
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Val/Base.hs
r12110 r12198 7 7 import Pugs.Internals 8 8 import {-# SOURCE #-} Pugs.Val 9 10 11 -- Goal: associate each builtin type with prim methods (that handles native monotypes) 12 -- its metaclass then get those as the initial method slots 13 -- still have to maintain a list of builtin bootstrap classes somewhere 14 -- but everything else can be reflected via Coercible 15 -- 16 -- Plan: Each prim type has a static fixed META class 9 17 10 18 class (Monad m, Functor m, Eq a, Data a, Typeable a) => ICoercible m a | a -> m where -
src/Pugs/Val/Code.hs
r12179 r12198 66 66 { s_invocant :: Param 67 67 , s_requiredPositionalCount :: Int 68 , s_requiredNames :: Set I dent68 , s_requiredNames :: Set ID 69 69 , s_positionalList :: [Param] 70 , s_namedSet :: Map I dentParam70 , s_namedSet :: Map ID Param 71 71 , s_slurpyScalarList :: [Param] 72 72 , s_slurpyArray :: Maybe Param … … 77 77 | SigSubSingle 78 78 { s_requiredPositionalCount :: Int 79 , s_requiredNames :: Set I dent79 , s_requiredNames :: Set ID 80 80 , s_positionalList :: [Param] 81 , s_namedSet :: Map I dentParam81 , s_namedSet :: Map ID Param 82 82 , s_slurpyScalarList :: [Param] 83 83 , s_slurpyArray :: Maybe Param … … 99 99 -} 100 100 data Param = MkParam 101 { p_variable :: I dent-- ^ E.g. $m above101 { p_variable :: ID -- ^ E.g. $m above 102 102 , p_types :: [Types.Type] -- ^ Static pieces of inferencer-food 103 103 -- E.g. Elk above … … 106 106 , p_unpacking :: Maybe PureSig -- ^ E.g. BinTree $t (Left $l, Right $r) 107 107 , p_default :: Maybe Exp -- ^ E.g. $answer? = 42 108 , p_label :: I dent-- ^ E.g. :mode108 , p_label :: ID -- ^ E.g. :mode 109 109 , p_slots :: Table -- ^ Any additional attrib not 110 110 -- explicitly mentioned below … … 136 136 data Arglist a = MkArglist 137 137 { a_positional :: [a] 138 , a_named :: Map I dent [a]-- ^ maps to [a] and not a since if the Sig stipulates139 -- @x, "x => 1, x => 2" constructs @x = (1, 2).138 , a_named :: Map ID [a] -- ^ maps to [a] and not a since if the Sig stipulates 139 -- @x, "x => 1, x => 2" constructs @x = (1, 2). 140 140 } 141 141 deriving (Show, Eq, Ord, Data, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-}
