Skip to content

Instantly share code, notes, and snippets.

--runL2Computation :: (Functor m, MonadST m) => L2 -> m (ComputationResult FrozenL2Computer)
--runL2Computation :: (MonadComputer (CE m) m a) => L2 -> m (CE m)
runL2Computation p = do
ce <- newRunningCE <$> (newComputer $ adjustMain p)
blah@(output, (haltEither, ce')) <- runOutputT $ runStateT (runErrorT $ runComputer step) ce
fzce <- freezeCE ce'
let x = mkComputationResult (output, (haltEither, fzce))
return blah
--return $ mkComputationResult (output, (haltEither, fzce))
src/L/L2/L2Interp.hs:66:87:
Could not deduce (MonadState
(CE (ErrorT Halt (StateT (CE m) (OutputT m))))
(StateT (CE m) (OutputT m)))
arising from a use of ‘step’
from the context (MonadComputer (CE m) m a)
bound by the type signature for
runL2Computation :: (MonadComputer (CE m) m a) =>
L2 -> m ([Output], (Either Halt (), CE m))
at src/L/L2/L2Interp.hs:63:21-93
Hi I am volunteering for Hadoop/R/Neo 4j workshop and career fair in Boston on Nov 6,7 2014 at the courtyard Boston off Tremont Street. . We are looking for volunteers for the event who will receive free passes. Features of the 2-day event, 1. Workshops - Learn from the experts http://analyticsweek.com/street/workshops 2. Career Fair - Free for job seekers 3. Conference - Network with CISOs, CMOs & IT C-level execs If you need any additional information please email me at naveena@analyticsweek.com or call me at 603 682 4319 Look forward to your participation. Please share the free career event for job seekers to all members. Thank you, Best Regards,
Hi I am volunteering for Hadoop/R/Neo 4j workshop and career fair
in Boston on Nov 6,7 2014 at the courtyard Boston off Tremont Street.
We are looking for volunteers for the event who will receive free passes.
Features of the 2-day event,
1. Workshops - Learn from the experts http://analyticsweek.com/street/workshops
2. Career Fair - Free for job seekers
3. Conference - Network with CISOs, CMOs & IT C-level execs
If you need any additional information please email me at
naveena@analyticsweek.com or call me at 603 682 4319
data Runtime = Num Int64 | Pointer Int64 | FunctionPointer String deriving Eq
type MonadRuntime m = MonadError (Halt String) m
expectPointer :: MonadRuntime m => String -> Runtime -> m Int64
expectPointer _ (Pointer i) = return i
expectPointer caller r = simpleException $ caller ++ " expected Pointer, but got: " ++ showRuntime r
data Memory s = Memory {
_runMemory :: STVector s Runtime
,_heapP :: Int64 -- pointer to top of heap
writeMem :: MonadMemory mem m => String -> Runtime -> Runtime -> m ()
writeMem caller addr value = do
m <- use memory
ep <- runErrorT $ expectPointer (caller ++ "/writeMem") addr
case ep of
(Left (Exceptional msg _)) -> exception msg m
(Left Normal) -> exception "unexpected/impossible Normal Halt" m
(Right p) ->
let index = (p `div` 8) :: Int64
inbounds = index < memSize
@joshcough
joshcough / CoreLexer.x
Last active August 29, 2015 14:08 — forked from dagit/CoreLexer.x
{
{-# OPTIONS -w #-}
module CoreLexer
( Alex(..)
, AlexPosn(..)
, Token(..)
, alexMonadScan
, runAlex
, alexGetInput
) where
private
z : Int
z = 5
a : Int
a = 2
assembleBindings :: (Monad m, TokenParsing m, Ord a, Show a) =>
[(Privacy, [a], Ann)] -- type annotations
-> [(Privacy, a, Bodies Text a)] -- term bodies
-> m [(Privacy, Binding Ann a)]
assembleBindings annots bodies = return res where -- error "todo assembleBindings" where
-- todo: change error to fail. that will change a lot of this code to use foldM
-- todo: we'll also want/need to give location information on errors
-- todo: that might require some more info to be passed into this function
-- todo: might consider different errors:
-- multiple type annotations for: t
-- todo: we'll want/need to give location information on errors
-- todo: that might require some more info to be passed into this function
-- todo: might consider different errors:
-- multiple type annotations for: t
-- multiple bindings with name: t
assembleBindings :: (Monad m, TokenParsing m, Ord a, Show a) =>
[(Privacy, [a], Ann)] -- ^ types
-> [(Privacy, a, [PreBody Ann a])] -- ^ terms
-> m [(Privacy, Term.Binding Ann a)] -- ^ bindings
assembleBindings types terms = do