text:
module E.FromHs(
    convertDecls,
    convertRules,
    createInstanceRules,
    procAllSpecs,
    getMainFunction
    ) where

import Char
import Control.Applicative(Applicative)
import Control.Monad.Error
import Control.Monad.Identity
import Control.Monad.RWS
import List(isPrefixOf,nub)
import Prelude
import Text.Printf
import qualified Data.Map as Map
import qualified Data.Traversable as T
import qualified Text.PrettyPrint.HughesPJ as PPrint

import C.FFI
import C.Prims as CP
import DataConstructors
import Doc.DocLike
import Doc.PPrint
import E.E
import E.Eta
import E.Eval(eval)
import E.LetFloat(atomizeAp)
import E.PrimDecode
import E.Rules
import E.Show(render)
import E.Subst
import E.Traverse
import E.TypeCheck
import E.Values
import FrontEnd.Class
import FrontEnd.HsSyn as HS
import FrontEnd.Rename(unRename)
import FrontEnd.Syn.Traverse(getNamesFromHsPat)
import FrontEnd.Tc.Main(isTypePlaceholder)
import FrontEnd.Tc.Module(TiData(..))
import FrontEnd.Tc.Type hiding(Rule(..))
import FrontEnd.Warning
import Info.Types
import Name.Id
import Name.Name as Name
import Name.Names
import Name.VConsts
import Options
import PackedString
import StringTable.Atom
import Support.CanType
import Support.FreeVars
import Util.Gen
import Util.NameMonad
import Util.SetLike
import qualified FlagOpts as FO
import qualified FrontEnd.Tc.Type as T(Rule(..))
import qualified FrontEnd.Tc.Type as Type
import qualified Info.Info as Info

ump sl e = EError (show sl ++ ": Unmatched pattern") e

r_bits32       = ELit litCons { litName = rt_bits32, litType = eHash }
r_bits_max_    = ELit litCons { litName = rt_bits_max_, litType = eHash }
r_bits_ptr_    = ELit litCons { litName = rt_bits_ptr_, litType = eHash }

createIf e a b = do
    [tv] <- newVars [Unknown]
    return $ createIfv tv e a b

createIfv v e a b = res where
    tv = v { tvrType = tBoolzh }
    ic = eCase (EVar tv) [Alt lTruezh a, Alt lFalsezh b] Unknown
    res = eCase e [Alt (litCons { litName = dc_Boolzh, litArgs = [tv], litType = tBool }) ic] Unknown

ifzh e a b = eCase e [Alt lTruezh a, Alt lFalsezh b] Unknown

newVars :: UniqueProducer m => [E] -> m [TVr]
newVars xs = f xs [] where
    f [] xs = return $ reverse xs
    f (x:xs) ys = do
        s <- newUniq
        f xs (tVr (anonymous s) x:ys)

tipe t = f t where
    f (TAp (TAp (TCon arr) a1) a2) | tyconName arr == tc_Arrow = f (TArrow a1 a2)
    f (TAp t1 t2) = eAp (f t1) (f t2)
    f (TArrow t1 t2) =  EPi (tVr emptyId (f t1)) (f t2)
    f (TCon (Tycon n k)) | Just n' <- Map.lookup n primitiveAliases = ELit litCons { litName = n', litType = kind k }
    f (TCon (Tycon n k)) =  ELit litCons { litName = n, litType = kind k }
    f (TVar tv) = EVar (cvar [] tv)
    f (TMetaVar mv) = cmvar mv
    f (TForAll vs (ps :=> t)) = foldr EPi (f t) (map (cvar $ freeVars ps) vs)
    f (TExists xs (_ :=> t)) = let
        xs' = map (kind . tyvarKind) xs
        in ELit litCons { litName = unboxedNameTuple TypeConstructor (length xs' + 1), litArgs = f t:xs', litType = eHash }
    f TAssoc {} = error "E.FromHs.tipe TAssoc"
    cvar fvs tv@Tyvar { tyvarName = n, tyvarKind = k }
        | tv `elem` fvs = setProperty prop_SCRUTINIZED (tVr (lt n) (kind k))
        | otherwise = tVr (lt n) (kind k)
    cmvar MetaVar { metaKind = k } = tAbsurd (kind k)
    lt n | nameType n == TypeVal = toId n  -- verifies namespace
         | otherwise = error "E.FromHs.lt"

kind (KBase KUTuple) = eHash
kind (KBase KHash) = eHash
kind (KBase Star) = eStar
kind (KBase KQuest) = eStar      -- XXX why do these still exist?
kind (KBase KQuestQuest) = eStar
kind (Kfun k1 k2) = EPi (tVr emptyId (kind k1)) (kind k2)
kind (KVar _) = error "Kind variable still existing."
kind _ = error "E.FromHs.kind: unknown"

fromTyvar (Tyvar n k) = tVr (toId n) (kind k)

fromSigma (TForAll vs (_ :=> t)) = (map fromTyvar vs, tipe t)
fromSigma t = ([], tipe t)

monadicLookup' k m = case Map.lookup k m of
    Just x  -> return x
    Nothing -> fail $ "key not found: " ++ show k

convertValue n = do
    assumps <- asks ceAssumps
    dataTable <- asks ceDataTable
    t <- monadicLookup' n assumps
    let ty = removeNewtypes dataTable (tipe t)
    cc <- asks ceCoerce
    lm <- case Map.lookup n cc of
        Nothing -> do
            let (vs,_) = fromSigma t
            return (flip (foldr eLam) vs)
        Just CTId -> do return id
        Just ~(CTAbs ts) -> do return $ \e -> foldr eLam e (map fromTyvar ts)
    return (tVr (toId n) ty,ty,lm)

--convertType t = do
--    dataTable <- asks ceDataTable
--    return $ removeNewtypes dataTable (tipe t)

matchesConv ms = map v ms where
    v (HsMatch _ _ ps rhs wh) = (ps,rhs,wh)

altConv as = map v as where
    v (HsAlt _ p rhs wh) = ([p],rhs,wh)

argTypes e = span (sortSortLike . getType) (map tvrType xs) where
    (_,xs) = fromPi e
argTypes' :: E -> ([E],E)
argTypes' e = let (x,y) = fromPi e in (map tvrType y,x)

getMainFunction :: Monad m => DataTable -> Name -> (Map.Map Name (TVr,E)) -> m (TVr,E)
getMainFunction dataTable name ds = do
  mt <- case Map.lookup name ds of
    Just x -> return x
    Nothing -> fail $ "Could not find main function: " ++ show name
  let funcs = runIdentity $ T.mapM (\n -> return . EVar . fst $ runEither (show n) $ monadicLookup' n ds) sFuncNames
  nameToEntryPoint dataTable (fst mt) (mkName termLevel False Nothing "theMain") Nothing funcs

nameToEntryPoint :: Monad m => DataTable -> TVr -> Name -> Maybe FfiExport -> FuncNames E -> m (TVr,E)
nameToEntryPoint dataTable main cname ffi ds = ans where
    ans = do
        let runMain      = func_runMain ds
            runExpr      = func_runExpr ds
            runNoWrapper = func_runNoWrapper ds
            runRaw       = func_runRaw ds
        let e = case extractIO (getType maine) of
                Just x | not (fopts FO.Wrapper) -> EAp (EAp runNoWrapper x) maine
                Just x ->  EAp (EAp runMain  x ) maine
                Nothing | fopts FO.Raw -> EAp (EAp runRaw ty) maine
                Nothing ->  EAp (EAp runExpr ty) maine
            ne = ELam worldVar (EAp e (EVar worldVar))
            worldVar = tvr { tvrIdent = va1, tvrType = tWorld__ }
            theMainTvr =  tVr (toId cname) (infertype dataTable ne)
            tvm@(TVr { tvrType =  ty}) =  main
            maine = foldl EAp (EVar tvm) [ tAbsurd k |  TVr { tvrType = k } <- xs, sortKindLike k ]
            (_,xs) = fromPi ty
        return (tvrInfo_u (case ffi of Just ffi -> Info.insert ffi; Nothing -> id) $ setProperty prop_EXPORTED theMainTvr,ne)

-- | create a RULE for each instance attached to the class methods.
-- These rules allow early specialization of monomorphic code, and are
-- eventually used in E.TypeAnalysis.expandPlaceholder to fill out
-- the generic class method bodies.

{-# NOINLINE createInstanceRules #-}
createInstanceRules :: Monad m => DataTable -> ClassHierarchy -> [(TVr,E)] -> m Rules
createInstanceRules dataTable classHierarchy funcs = return $ fromRules ans where
    ans = concatMap cClass (classRecords classHierarchy)
    cClass classRecord = concat [ method classRecord n mve |
        (n,TForAll _ (_ :=> t)) <- classAssumps classRecord, mve <- findName n ]
    method classRecord methodName (methodVar,_) = as where
        ty = tvrType methodVar
        defaultName = defaultInstanceName methodName
        as = [ rule t | Inst { instHead = _ :=> IsIn _ t } <- snub (findClassInsts classHierarchy (className classRecord)) ]
        rule t = makeRule ("Rule.{" ++ show name ++ "}") (toModule (show name),0)
                RuleSpecialization ruleFvs methodVar (vp:map EVar args) (removeNewtypes dataTable body) where
            ruleFvs = [ t | ~(EVar t) <- vs] ++ args
            (vp,vs) = valToPat' (removeNewtypes dataTable $ tipe t)
            name = instanceName methodName (getTypeCons t)
            bodyt = foldl eAp ty (vp:map EVar args)
            body = case findName name of
                Just (n,_) -> runIdentity $ do actuallySpecializeE (EVar n) bodyt
                Nothing -> case findName defaultName of
                    Just (deftvr,_) | otherwise -> runIdentity $ do actuallySpecializeE (EVar deftvr) bodyt
                    Nothing -> EError ( show methodName ++ ": undefined at type " ++  PPrint.render (pprint t)) bodyt
                    --Just (deftvr,_) -> eLet tv vp $ runIdentity $ do actuallySpecializeE (EVar deftvr) (foldl eAp ty $ EVar tv:map EVar args) where -- foldl EAp (EAp (EVar deftvr) (EVar tv)) (map EVar args) where
                    --    tv = tvr { tvrIdent = head [ n | n <- newIds (freeVars vp `mappend` fromList (map tvrIdent args))], tvrType = getType vp }
                    --Just (deftvr,_) | null vs -> foldl EAp (EAp (EVar deftvr) vp) (map EVar args)

        -- this assumes the class argument is always the first type parameter
        (_,_:args') = fromPi ty
        (args,_) = span (sortKindLike . tvrType)  args'

        someIds = newIds (fromList $ map tvrIdent args')
        valToPat' (ELit LitCons { litAliasFor = af,  litName = x, litArgs = ts, litType = t }) = ans where
            ans = (ELit litCons { litAliasFor = af, litName = x, litArgs = ts', litType = t },ts')
            ts' = [ EVar (tVr j (getType z)) | z <- ts | j <- someIds]
        valToPat' (EPi tv@TVr { tvrType =  a} b)  = (EPi tvr { tvrType =  a'} b',[a',b']) where
            a' = EVar (tVr ja (getType a))
            b' = EVar (tVr jb (getType b))
            (ja:jb:_) = someIds
        valToPat' x = error $ "FromHs.valToPat': " ++ show x

    funcsMap = Map.fromList [ (n,(v,e)) | (v,e) <- funcs, let Just n = fromId (tvrIdent v) ]
    findName name = case Map.lookup name funcsMap of
        Nothing -> fail $ "Cannot find: " ++ show name
        Just n -> return n

getTypeCons (TCon (Tycon n _)) = n
getTypeCons (TAp a _) = getTypeCons a
getTypeCons (TArrow {}) = tc_Arrow
getTypeCons x = error $ "getTypeCons: " ++ show x

unbox :: DataTable -> E -> Id -> (E -> E) -> E
unbox dataTable e _vn wtd | getType (getType e) == eHash = wtd e
unbox dataTable e vn wtd = eCase e [Alt (litCons { litName = cna, litArgs = [tvra], litType = te }) (wtd (EVar tvra))] Unknown where
    te = getType e
    tvra = tVr vn sta
    Just (ExtTypeBoxed cna sta _) = lookupExtTypeInfo dataTable te

createFunc :: [E] -> ([TVr] -> C (E -> E,E)) -> C E
createFunc es ee = do
    dataTable <- getDataTable
    xs <- flip mapM es $ \te -> do
        eti <- ffiTypeInfo ExtTypeVoid te return
        [n] <- newVars [te]
        case eti of
            ExtTypeVoid -> fail "createFunc: attempt to pass a void argument"
            ExtTypeBoxed cn sta _ -> do
                [n'] <- newVars [sta]
                return (n,n',Just cn)
            ExtTypeRaw _ -> do
                return (n,n,Nothing)
    let tvrs' = [ n' | (_,n',_) <- xs ]
        tvrs = [ t | (t,_,_) <- xs]
    (me,innerE) <- ee tvrs'
    let eee = me $ foldr esr innerE xs
        esr (tvr,tvr',Just cn) e = eCase (EVar tvr) [Alt (litCons { litName = cn, litArgs = [tvr'], litType = tvrType tvr }) e] Unknown
        esr (_,_,Nothing) e = e
    return $ foldr ELam eee tvrs

instance GenName String where
   genNames i = map (('x':) . show) [i..]

{-# NOINLINE convertRules #-}
convertRules :: Module -> TiData -> ClassHierarchy -> Map.Map Name Type -> DataTable -> [HsDecl] -> IO Rules
convertRules mod tiData classHierarchy assumps dataTable hsDecls = ans where
    ans = do
        rawRules <- concatMapM g hsDecls
        return $ fromRules [ makeRule n (mod,i) (if catalyst then RuleCatalyst else RuleUser) vs head args e2 | (catalyst,n,vs,e1,e2) <- rawRules, let (EVar head,args) = fromAp e1 | i <- [1..] ]
    g (HsPragmaRules rs) = mapM f rs
    g _ = return []
    f pr = do
        let ce = convertE tiData classHierarchy assumps dataTable (hsRuleSrcLoc pr)
        e1 <- ce (hsRuleLeftExpr pr)
        e2 <- ce (hsRuleRightExpr pr)
        (ts,cs) <- runNameMT $ do
            ts <- flip mapM (filter (sortKindLike . getType) $ freeVars e1) $ \tvr -> do
                --return (tvrIdent tvr,tvr)
                nn <- newNameFrom (map (:'\'':[]) ['a' ..])
                return (tvrIdent tvr,tvr { tvrIdent = toId (toName TypeVal nn) })
            cs <- flip mapM [toTVr assumps dataTable (toName Val v) | (v,_) <- hsRuleFreeVars pr ] $ \tvr -> do
                let ur = show $ unRename (toUnqualified $ runIdentity $ fromId (tvrIdent tvr))
                nn <- newNameFrom (ur:map (\v -> ur ++ show v) [1 ::Int ..])
                return (tvrIdent tvr,tvr { tvrIdent = toId (toName Val nn) })
            return (ts,cs)
        let smt = substMap $ fromList [ (x,EVar y)| (x,y) <- ts ]
            sma = substMap $ fromList [ (x,EVar y)| (x,y) <- cs' ]
            cs' =  [ (x,(tvrType_u smt y))| (x,y) <- cs ]
            e2' = deNewtype dataTable $ smt $ sma e2
        --e2 <- atomizeAp False dataTable Stats.theStats mainModule e2'
        let e2 = atomizeAp mempty False dataTable e2'
        return (hsRuleIsMeta pr,hsRuleString pr,( snds (cs' ++ ts) ),eval $ smt $ sma e1,e2)

convertE :: TiData -> ClassHierarchy -> Map.Map Name Type
    -> DataTable -> SrcLoc -> HsExp -> IO E
convertE tiData classHierarchy assumps dataTable srcLoc exp = do
    [(_,_,e)] <- convertDecls tiData mempty classHierarchy assumps dataTable
        [HsPatBind srcLoc (HsPVar v_silly) (HsUnGuardedRhs exp) []]
    return e

v_silly = toName Val ("Jhc@","silly")

data CeEnv = CeEnv {
    ceAssumps :: Map.Map Name Type,
    ceCoerce :: Map.Map Name CoerceTerm,
    ceFuncs  :: FuncNames E,
    ceProps  :: IdMap Properties,
    ceSrcLoc :: SrcLoc,
    ceDataTable :: DataTable
    }

newtype C a = Ce (RWST CeEnv [Warning] Int IO a)
    deriving(Monad,Applicative,Functor,MonadIO,MonadReader CeEnv,MonadState Int,MonadError IOError)

instance MonadWarn C where
    addWarning w = liftIO (addWarning w)

instance MonadSrcLoc C where
    getSrcLoc = asks ceSrcLoc

instance MonadSetSrcLoc C where
    withSrcLoc' sl = local (\ce -> ce { ceSrcLoc = sl })

instance UniqueProducer C where
    newUniq = do
        i <- get
        put $! (i + 1)
        return i

instance DataTableMonad C where
    getDataTable = asks ceDataTable

applyCoersion :: CoerceTerm -> E -> C E
applyCoersion CTId e = return e
applyCoersion ct e = etaReduce `liftM` f ct e where
    f CTId e = return e
    f (CTAp ts) e = return $ foldl eAp e (map tipe ts)
    f (CTAbs ts) e = return $ foldr eLam e (map fromTyvar ts)
    f (CTCompose ct1 ct2) e = f ct1 =<< (f ct2 e)
    f (CTFun CTId) e = return e
    f (CTFun ct) e = do
        let EPi TVr { tvrType = ty } _ = getType e
        [y] <- newVars [ty]
        fgy <- f ct (EAp e (EVar y))
        return (eLam y fgy)

fromTuple_ :: Monad m => E -> m [E]
fromTuple_ (ELit LitCons { litName = n, litArgs = as }) | Just c <- fromUnboxedNameTuple n, c == length as = return as
fromTuple_ e = fail "fromTuple_ : not unboxed tuple"

{-# NOINLINE convertDecls #-}
convertDecls :: TiData -> IdMap Properties
    -> ClassHierarchy -> Map.Map Name Type -> DataTable
    -> [HsDecl] -> IO [(Name,TVr,E)]
convertDecls tiData props classHierarchy assumps dataTable hsDecls = res where
    res = do
        (a,ws) <- evalRWST ans ceEnv 2
        mapM_ addWarning ws
        return a
    ceEnv = CeEnv {
        ceCoerce = tiCoerce tiData,
        ceAssumps = assumps,
        ceFuncs = funcs,
        ceProps = props,
        ceSrcLoc = bogusASrcLoc,
        ceDataTable = dataTable
        }
    Identity funcs = T.mapM (return . EVar . toTVr assumps dataTable) sFuncNames
    Ce ans = do
        nds <- mapM cDecl' hsDecls
        return (map anninst $ concat nds)
    doNegate e = eAp (eAp (func_negate funcs) (getType e)) e
    anninst (a,b,c)
        | "Instance@" `isPrefixOf` show a = (a,setProperty prop_INSTANCE b, deNewtype dataTable c)
        | otherwise = (a,b, deNewtype dataTable c)

    -- first argument builds the actual call primitive, given
    -- (a) the C argtypes
    -- (b) the C return type
    -- (c) the extra return variables passed back in pointers
    -- (d) the arguments themselves
    -- (e) the real return type
    -- ccallHelper returns a function expression to perform the call, when given the arguments
    invalidDecl s = addWarn InvalidDecl s >> fail s
    ccallHelper :: ([ExtType] -> ExtType -> [ExtType] -> [E] -> E -> E) -> E -> C E
    ccallHelper myPrim ty = do
        let (ts,isIO,rt) = extractIO' ty
        es <- newVars [ t |  t <- ts, not (sortKindLike t) ]
        let (rt':ras) = case fromTuple_ rt of
                Just (x:ys@(_:_)) -> (x:ys)
                _ -> [rt]
        ras' <- forM ras $ \t -> ffiTypeInfo ExtTypeVoid t return
        ffiTypeInfo Unknown rt' $ \pt -> do
        cts <- forM  (filter (not . sortKindLike) ts) $ \t -> do ffiTypeInfo ExtTypeVoid t $ return
        [tvrWorld, tvrWorld2] <- newVars [tWorld__,tWorld__]
        let cFun = createFunc (map tvrType es)
            prim = myPrim (map extTypeInfoExtType cts) (extTypeInfoExtType pt) (map extTypeInfoExtType ras')
        case (isIO,pt,ras') of
            (True,ExtTypeVoid,[]) -> cFun $ \rs -> return (ELam tvrWorld,
                eStrictLet tvrWorld2 (prim (EVar tvrWorld :[EVar t | t <- rs ]) tWorld__)
                    (eJustIO (EVar tvrWorld2) vUnit))
            (False,ExtTypeVoid,_) -> invalidDecl  "pure foreign function must return a non void value"
            (True,_,(_:_)) -> invalidDecl "IO-like functions may not return a tuple"
            (_,ExtTypeBoxed cn rtt' _,[]) -> do
                [rtVar,rtVar'] <- newVars [rt',rtt']
                let rttIO' = ltTuple' [tWorld__, rtt']
                case isIO of
                    False -> cFun $ \rs -> return (id,
                        eStrictLet rtVar' (prim [ EVar t | t <- rs ] rtt')
                            (ELit $ litCons { litName = cn, litArgs = [EVar rtVar'], litType = rt' }))
                    True -> cFun $ \rs -> return $ (,) (ELam tvrWorld) $
                        eCaseTup' (prim (EVar tvrWorld:[EVar t | t <- rs ]) rttIO') [tvrWorld2,rtVar']
                            (eLet rtVar (ELit $ litCons { litName = cn, litArgs = [EVar rtVar'], litType = rt' })
                                (eJustIO (EVar tvrWorld2) (EVar rtVar)))
            (True,ExtTypeRaw  _,[]) -> do
                let rttIO' = ltTuple' [tWorld__, rt']
                cFun $ \rs -> return (ELam tvrWorld,prim (EVar tvrWorld:[EVar t | t <- rs ]) rttIO')
            (False,ExtTypeRaw  _,[]) -> do
                cFun $ \rs -> return (id,prim [EVar t | t <- rs ] rt')
            (False,_,(_:_)) -> do
                let rets = (rt':ras)
                rets' <- mapM unboxedVersion rets
                cFun $ \rs -> do
                fun <- extractUnboxedTup (prim [ EVar t | t <- rs ] (ltTuple' rets')) $ \vs -> do
                    rv <- zipWithM marshallFromC vs rets
                    return $ eTuple' rv
                return (id,fun)
            -- _ -> invalidDecl "foreign declaration is of incorrect form."

    --isExtTypeRaw ExtTypeRaw {} = True
    --isExtTypeRaw _ = False

    cDecl,cDecl' :: HsDecl -> C [(Name,TVr,E)]
    cDecl' d = withSrcLoc (srcLoc d) $ catchError (cDecl d) $ \ (e :: IOError) -> do
        warn (srcLoc d) InvalidDecl $ "caught error processing decl: " ++ show e
        return []
    cDecl (HsForeignDecl sLoc (FfiSpec (Import cn req) _ Primitive) n _) = do
        let name      = toName Name.Val n
        (var,ty,lamt) <- convertValue name
        let (ts,rt)   = argTypes' ty
        es <- newVars [ t |  t <- ts, not (sortKindLike t) ]
        result <- processPrim dataTable sLoc (toAtom cn)
            [ EVar e | e <- es, not (tvrType e == tUnit)] rt req
        return [(name,setProperty prop_INLINE var,
                 lamt $ foldr ($) result (map ELam es))]
    cDecl (HsForeignDecl _ (FfiSpec (ImportAddr rcn req) _ _) n _) = do
        let name       = toName Name.Val n
        (var,ty,lamt)  <- convertValue name
        let (_ts,rt)   = argTypes' ty
            expr x     = return [(name,setProperty prop_INLINE var,lamt x)]
            prim       = (AddrOf req $ packString rcn)
        -- this needs to be a boxed value since we can't have top-level
        -- unboxed values yet.
        ffiTypeInfo [] rt $ \eti -> do
        case eti of
            ExtTypeBoxed cn st _ -> do
                [uvar] <- newVars [st]
                expr $ eStrictLet uvar (EPrim prim [] st) (ELit (litCons { litName = cn, litArgs = [EVar uvar], litType = rt }))
            _ -> invalidDecl "foreign import of address must be of a boxed type"

    cDecl (HsForeignDecl _ (FfiSpec (Import rcn req) safe CCall) n _) = do
        let name = toName Name.Val n
        (var,ty,lamt) <- convertValue name
        result <- ccallHelper
                     (\cts crt cras args rt ->
                      EPrim (Func req (packString rcn) cts crt cras safe) args rt)
                     ty
        return [(name,setProperty prop_INLINE var,lamt result)]
    cDecl (HsForeignDecl _ (FfiSpec Dynamic _ CCall) n _) = do
        -- XXX ensure that the type is of form FunPtr /ft/ -> /ft/
        let name = toName Name.Val n
        (var,ty,lamt) <- convertValue name
        --let ((fptrTy:_), _) = argTypes' ty
        --    fty = discardArgs 1 ty
        result <- ccallHelper
                     (\cts crt cras args rt ->
                      EPrim (IFunc mempty (tail cts) crt) args rt)
                     ty
        return [(name,setProperty prop_INLINE var,lamt result)]

    cDecl (HsForeignDecl _ (FfiSpec (Import rcn _) _ DotNet) n _) = do
        (var,ty,lamt) <- convertValue (toName Name.Val n)
        let (ts,isIO,rt') = extractIO' ty
        es <- newVars [ t |  t <- ts, not (sortKindLike t) ]
        ffiTypeInfo [] rt' $ \pt -> do
        [tvrWorld, tvrWorld2] <- newVars [tWorld__,tWorld__]
        dnet <- parseDotNetFFI rcn
        let cFun = createFunc (map tvrType es)
            prim rs rtt = EPrim dnet
        result <- case (isIO,pt) of
            (True,ExtTypeVoid) -> cFun $ \rs -> return $  (,) (ELam tvrWorld) $
                        eStrictLet tvrWorld2 (prim rs "void" (EVar tvrWorld:[EVar t | t <- rs ]) tWorld__) (eJustIO (EVar tvrWorld2) vUnit)
            (False,ExtTypeVoid) -> invalidDecl "pure foreign function must return a valid value"
            _ -> do
                ExtTypeBoxed cn rtt' rtt <- lookupExtTypeInfo dataTable rt'
                [rtVar,rtVar'] <- newVars [rt',rtt']
                let _rttIO = ltTuple [tWorld__, rt']
                    rttIO' = ltTuple' [tWorld__, rtt']
                case isIO of
                    False -> cFun $ \rs -> return $ (,) id $ eStrictLet rtVar' (prim rs rtt [ EVar t | t <- rs ] rtt') (ELit $ litCons { litName = cn, litArgs = [EVar rtVar'], litType = rt' })
                    True -> cFun $ \rs -> return $ (,) (ELam tvrWorld) $
                                eCaseTup' (prim rs rtt (EVar tvrWorld:[EVar t | t <- rs ]) rttIO')  [tvrWorld2,rtVar'] (eLet rtVar (ELit $ litCons { litName = cn, litArgs = [EVar rtVar'], litType = rt' }) (eJustIO (EVar tvrWorld2) (EVar rtVar)))
        return [(toName Name.Val n,var,lamt result)]

    cDecl x@HsForeignDecl {} = invalidDecl ("Unsupported foreign declaration: "++ show x)

    cDecl (HsForeignExport _ ffi@FfiExport { ffiExportCName = ecn } n _) = do
        let name = ffiExportName ffi
        fn <- convertVar name
        tn <- convertVar (toName Name.Val n)

        (var,ty,lamt) <- convertValue name
        let --(argTys,retTy') = argTypes' ty
            --(isIO,retTy) = extractIO' retTy'
            (argTys,isIO,retTy) = extractIO' ty

        --retCTy <- if retTy == tUnit
         --         then return unboxedTyUnit
         --         else liftM (\(_, _, x) -> rawType x) $ lookupCType' dataTable retTy

        aets <- forM argTys $ \ty -> do
            ffiTypeInfo (Unknown,undefined,undefined) ty $ \eti -> do
--            eti <- lookupExtTypeInfo dataTable ty
            ty' <- case eti of
                ExtTypeVoid -> invalidDecl "attempt to foreign export function with void argument"
                ExtTypeRaw _ -> do return ty
                ExtTypeBoxed _ ty' _  -> do return ty'
            [v] <- newVars [ty']
            e <- marshallFromC (EVar v) ty
            return (e,v,ty')

        let argEs   = [ e | (e,_,_) <- aets ]
            argTvrs = [ v | (_,v,_) <- aets ]
            argCTys = [ t | (_,_,t) <- aets ]
        fe <- actuallySpecializeE (EVar tn) ty
        let inner = foldl EAp fe argEs

        retE <- case isIO of
                  False -> marshallToC inner retTy
                  True -> do [world_, world__, ret] <- newVars [tWorld__, tWorld__, retTy]
                             retMarshall <- if retTy == tUnit
                                            then return (ELit (unboxedTuple []))
                                            else marshallToC (EVar ret) retTy
                             return (eLam world_ (eCaseTup' (eAp inner (EVar world_))
                                                            [world__, ret]
                                                            (ELit (unboxedTuple [EVar world__, retMarshall]))))

        let retCTy' = typeInfer dataTable retE

        -- trace ("retE: "++pprint retE) $ return ()

        let result = foldr ELam retE argTvrs

        realRetCTy:realArgCTys <- mapM (\x -> extTypeInfoExtType `liftM`  lookupExtTypeInfo dataTable x) (retTy:argTys)

        return [(name,
                 tvrInfo_u (Info.insert ffi { ffiExportArgTypes = realArgCTys, ffiExportRetType = realRetCTy } )
                           (fmap (const (foldr tFunc retCTy' argCTys)) $
                              setProperty prop_EXPORTED fn),
                 result)]

    cDecl (HsPatBind sl (HsPVar n) (HsUnGuardedRhs exp) []) | n == v_silly = do
        e <- cExpr exp
        return [(v_silly,tvr,e)]
    cDecl (HsPatBind sl p rhs wh) | (HsPVar n) <- p = do
        let name = toName Name.Val n
        (var,ty,lamt) <- convertValue name
        rhs <- cRhs sl rhs
        lv <- hsLetE wh rhs
        return [(name,var,lamt lv)]
    cDecl (HsPatBind sl p rhs wh) | (HsPVar n) <- p = do
        let name = toName Name.Val n
        (var,ty,lamt) <- convertValue name
        rhs <- cRhs sl rhs
        lv <- hsLetE wh rhs
        return [(name,var,lamt lv)]

    cDecl (HsPatBind sl p rhs wh) | (HsPVar n) <- p = do
        let name = toName Name.Val n
        (var,ty,lamt) <- convertValue name
        rhs <- cRhs sl rhs
        lv <- hsLetE wh rhs
        return [(name,var,lamt lv)]
    cDecl (HsFunBind [(HsMatch sl n ps rhs wh)]) | all isHsPVar ps = do
        let name = toName Name.Val n
        (var,ty,lamt) <- convertValue name
        rhs <- cRhs sl rhs
        lv <- hsLetE wh rhs
        lps <- lp ps lv
        return [(name,var,lamt lps )]
    cDecl (HsFunBind ms@((HsMatch sl n ps _ _):_)) = do
        let name = toName Name.Val n
        (var,t,lamt) <- convertValue name
        let (targs,eargs) = argTypes t
            numberPatterns = length ps
        bs' <- newVars (take numberPatterns eargs)
        let bs  = map EVar bs'
            rt = discardArgs (length targs + numberPatterns) t
            z e = foldr eLam e bs'
        ms <- cMatchs bs (matchesConv ms) (ump sl rt)
        return [(name,var,lamt $ z ms )]
    cDecl cd@(HsClassDecl {}) = cClassDecl cd
    cDecl _ = return []
    cExpr :: HsExp -> C E
    cExpr (HsAsPat n' (HsCon n)) = return $ constructionExpression dataTable (toName DataConstructor n) rt where
        t' = getAssump n'
        (_,rt) = argTypes' (tipe t')
    cExpr (HsLit (HsStringPrim s)) = return $ EPrim (PrimString (packString s)) [] r_bits_ptr_
    cExpr (HsLit (HsString s)) = return $ E.Values.toE s
    cExpr (HsAsPat n' (HsLit (HsIntPrim i))) = ans where
        t' = getAssump n'
        ans = return $ ELit (LitInt (fromIntegral i) (tipe t'))
    cExpr (HsAsPat n' (HsLit (HsCharPrim i))) = ans where
        t' = getAssump n'
        ans = return $ ELit (LitInt (fromIntegral $ ord i) (tipe t'))
    cExpr (HsAsPat n' (HsLit (HsInt i))) = ans where
        t' = getAssump n'
        ty = tipe t'
        -- XXX this can allow us to create integer literals out of things that
        -- arn't in Num if we arn't careful
        ans = case lookupExtTypeInfo dataTable ty of
            Just (ExtTypeBoxed cn st _) -> return $ ELit (litCons { litName = cn, litArgs = [ELit (LitInt (fromIntegral i) st)], litType = ty })
            _ -> return $ intConvert' funcs ty i
            --Just (cn,st,it) ->
    --cExpr (HsLit (HsInt i)) = return $ intConvert i
    cExpr (HsLit (HsChar ch)) = return $ toE ch
    cExpr (HsLit (HsCharPrim ch)) = return $ toEzh ch
    cExpr (HsLit (HsFrac i))  = return $ toE i
    cExpr (HsLambda sl ps e) | all isHsPVar ps = do
        e <- cExpr e
        lp ps e
    cExpr (HsInfixApp e1 v e2) = do
        v <- cExpr v
        e1 <- cExpr e1
        e2 <- cExpr e2
        return $ eAp (eAp v e1) e2
    cExpr (HsLeftSection op e) = liftM2 eAp (cExpr op) (cExpr e)
    cExpr (HsApp (HsRightSection e op) e') = do
        op <- cExpr op
        e' <- cExpr e'
        e <- cExpr e
        return $ eAp (eAp op e') e
    cExpr (HsRightSection e op) = do
        cop <- cExpr op
        ce <- cExpr e
        let (_,TVr { tvrType = ty}:_) = fromPi (getType cop)
        [var] <- newVars [ty]
        return $ eLam var (eAp (eAp cop (EVar var)) ce)
    cExpr (HsApp e1 e2) = liftM2 eAp (cExpr e1) (cExpr e2)
    cExpr (HsParen e) = cExpr e
    cExpr (HsExpTypeSig _ e _) = cExpr e
    cExpr (HsNegApp e) = liftM doNegate (cExpr e)
    cExpr (HsLet dl e) = hsLet dl e
    cExpr (HsIf e a b) = join $ liftM3 createIf (cExpr e) (cExpr a) (cExpr b)
    cExpr (HsCase _ []) = error "empty case"
    cExpr (HsAsPat n HsError { hsExpString = msg }) = do
        ty <- convertTyp (toName Name.Val n)
        return $ EError msg ty
    cExpr (HsAsPat n hs@(HsCase e alts)) = do
        ty <- convertTyp (toName Name.Val n)
        scrut <- cExpr e
        cMatchs [scrut] (altConv alts) (EError ("No Match in Case expression at " ++ show (srcLoc hs))  ty)
    cExpr (HsAsPat n hs@(HsLCase alts)) = do
        EPi tvr ty <- convertTyp (toName Name.Val n)
        [v] <- newVars [tvrType tvr]
        e <- cMatchs [EVar v] (altConv alts) (EError ("No Match in Case expression at " ++ show (srcLoc hs))  ty)
        return $ ELam v e
    cExpr (HsTuple es) = liftM eTuple (mapM cExpr es)
    cExpr (HsUnboxedTuple es) = liftM eTuple' (mapM cExpr es)
    cExpr (HsAsPat n (HsList xs)) = do
        ty <- convertTyp (toName Name.Val n)
        let cl (x:xs) = liftM2 eCons (cExpr x) (cl xs)
            cl [] = return $ eNil ty
        cl xs
    cExpr (HsVar n) = do
        t <- convertVar (toName Name.Val n)
        return (EVar t)
    cExpr (HsAsPat n' e) = do
        e <- cExpr e
        cc <- asks ceCoerce
        case Map.lookup (toName Val n') cc of
            Nothing -> return e
            Just c -> applyCoersion c e
    cExpr e = invalidDecl ("Cannot convert: " ++ show e)
    hsLetE [] e = return  e
    hsLetE dl e = do
        nds <- mconcatMapM cDecl dl
        return $ eLetRec [ (b,c) | (_,b,c) <- nds] e
    hsLet dl e = do
        e <- cExpr e
        hsLetE dl e

    cMatchs :: [E] -> [([HsPat],HsRhs,[HsDecl])] -> E -> C E
    cMatchs bs ms els = do
        pg <- processGuards ms
        convertMatches bs pg els

    cGuard (HsUnGuardedRhs e) = liftM const $ cExpr e
    cGuard (HsGuardedRhss (HsComp _ ~[HsQualifier g] e:gs)) = do
        g <- cExpr g
        e <- cExpr e
        fg <- cGuard (HsGuardedRhss gs)
        [nv] <- newVars [Unknown]
        return (\els -> createIfv nv g e (fg els))
    cGuard (HsGuardedRhss []) = return id

    getAssump n  = case Map.lookup (toName Name.Val n) assumps of
        Just z -> z
        Nothing -> error $ "Lookup failed: " ++ (show n)
    lp  [] e = return e
    lp  (HsPVar n:ps) e = do
        v <- convertVar (toName Name.Val n)
        eLam v `liftM` lp ps e
    lp  p e  =  error $ "unsupported pattern:" <+> tshow p  <+> tshow e
    cRhs sl (HsUnGuardedRhs e) = cExpr e
    cRhs sl (HsGuardedRhss []) = error "HsGuardedRhss: empty"
    cRhs sl (HsGuardedRhss gs@(HsComp _ _ e:_)) = f gs where
        f (HsComp _ ~[HsQualifier g] e:gs) = join $ liftM3 createIf (cExpr g) (cExpr e) (f gs)
        f [] = do
            e <- cExpr e
            return $ ump sl $ getType e
    processGuards xs = flip mapM xs $ \ (ps,e,wh) -> do
        cg <- cGuard e
        nds <- mconcatMapM cDecl wh
        let elet = eLetRec [ (b,c) | (_,b,c) <- nds]
        return (ps,elet . cg )

    cClassDecl (HsClassDecl _ chead decls) = do
        props <- asks ceProps
        let cr = findClassRecord classHierarchy className
            className = hsClassHead chead
            cClass classRecord =  [ f n (toId n) (removeNewtypes dataTable $ tipe t) | (n,t) <- classAssumps classRecord ] where
                f n i t = (n,setProperties [prop_METHOD,prop_PLACEHOLDER] $ tVr i t, foldr ELam (EPrim (primPrim ("Placeholder: " ++ show n)) [] ft) args)  where
                    (ft',as) = fromPi t
                    (args,rargs) = case mlookup i props of
                        Just p | getProperty prop_NOETA p -> span (sortKindLike . getType) as
                        _ -> (as,[])
                    ft = foldr EPi ft' rargs
        return (cClass cr)
    cClassDecl _ = error "cClassDecl"

convertVar n = do
    (t,_,_) <- convertValue n
    return t
convertTyp n = do
    (_,t,_) <- convertValue n
    return t

toTVr assumps dataTable n = tVr (toId n) typeOfName where
    typeOfName = case Map.lookup n assumps of
        Just z -> removeNewtypes dataTable (tipe z)
        Nothing -> error $ "convertVal.Lookup failed: " ++ (show n)

integer_cutoff = 500000000

intConvert i | abs i > integer_cutoff  =  ELit (litCons { litName = dc_Integer, litArgs = [ELit $ LitInt (fromInteger i) r_bits_max_], litType = tInteger })
intConvert i =  ELit (litCons { litName = dc_Int, litArgs = [ELit $ LitInt (fromInteger i) r_bits32], litType = tInt })

intConvert' funcs typ i = EAp (EAp fun typ) (ELit (litCons { litName = con, litArgs = [ELit $ LitInt (fromInteger i) rawtyp], litType = ltype }))  where
    (con,ltype,fun,rawtyp) = case abs i > integer_cutoff of
        True -> (dc_Integer,tInteger,f_fromInteger,r_bits_max_)
        False -> (dc_Int,tInt,f_fromInt,r_bits32)
    f_fromInt = func_fromInt funcs
    f_fromInteger = func_fromInteger funcs

litconvert (HsChar i) t | t == tChar =  LitInt (fromIntegral $ ord i) tCharzh
litconvert (HsCharPrim i) t | t == tCharzh =  LitInt (fromIntegral $ ord i) tCharzh
litconvert (HsIntPrim i) t  =  LitInt (fromIntegral i) t
litconvert e t = error $ "litconvert: shouldn't happen: " ++ show (e,t)

fromHsPLitInt (HsPLit l@(HsInt _)) = return l
fromHsPLitInt (HsPLit l@(HsFrac _)) = return l
fromHsPLitInt x = fail $ "fromHsPLitInt: " ++ show x

tidyPat
    :: HsPat
    -> E
    -> C (HsPat,E -> E)
tidyPat p b = f p where
    f HsPWildCard = return (HsPWildCard,id)
    f (HsPVar n) | isTypePlaceholder n = return (HsPWildCard,id)
    f (HsPAsPat n p) | isTypePlaceholder n = f p
    f (HsPTypeSig _ p _) = f p
    f p@HsPLit {} = return (p,id)
    f (HsPVar n) = do
        v <- convertVar (toName Name.Val n)
        return (HsPWildCard,if EVar v /=  b then eLet v b else id)
    f (HsPAsPat n p) = do
        (p',g') <- f p
        v <- convertVar (toName Name.Val n)
        return (p',(if EVar v /= b then eLet v b else id) . g')
    f (HsPTuple ps) = f (HsPApp (name_TupleConstructor termLevel (length ps)) ps)
    f (HsPUnboxedTuple ps) = f (HsPApp (name_UnboxedTupleConstructor termLevel (length ps)) ps)
    f pa@(HsPApp n [p]) = do
        dataTable <- getDataTable
        patCons <- getConstructor n dataTable
        case conChildren patCons of
            DataAlias ErasedAlias -> f p
            _ -> return (pa,id)
    f p@HsPApp {} = return (p,id)
    f (HsPIrrPat (Located ss p)) = f p >>= \ (p',fe) -> case p' of
        HsPWildCard -> return (p',fe)
        _ -> do
            (lbv,bv) <- varify b
            let f n = do
                v <- convertVar (toName Name.Val n)
                fe <- convertMatches [bv] [([p],const (EVar v))] (EError (show ss ++ ": Irrefutable pattern match failed") (getType v))
                return (v,fe)
            zs <- mapM f (getNamesFromHsPat p)
            return (HsPWildCard,lbv . eLetRec zs)
    f ~(HsPBangPat (Located ss (HsPAsPat v p))) = do
        (p',fe) <- f p
        v <- convertVar (toName Name.Val v)
        return (p',eStrictLet v b . fe)

-- converts a value to an updatable closure if it isn't one already.
varify b@EVar {} = return (id,b)
varify b = do
    [bv] <- newVars [getType b]
    return (eLet bv b,EVar bv)

tidyHeads
    :: E
    -> [([HsPat],E->E)]  -- [(pats,else -> value)]
    -> C [(HsPat,[HsPat],E->E)]  -- pulls the head off of each pattern, tidying it up perhaps
tidyHeads b ps = mapM f ps where
    f (~(p:ps),fe) = do
        (p',fe') <- tidyPat p b
        return (p',ps,fe' . fe)

convertMatches
    :: [E]               -- input expressions we are matching against.
    -> [([HsPat],E->E)]  -- [(pats,else -> value)]
    -> E                 -- else, what to do if nothing matches
    -> C E
convertMatches bs ms err = do
    assumps <- asks ceAssumps
    dataTable <- getDataTable
    funcs <- asks ceFuncs
    let fromInt = func_fromInt funcs
        fromInteger = func_fromInteger funcs
        fromRational = func_fromRational funcs
        isJoinPoint (EAp (EVar x) _) | getProperty prop_JOINPOINT x = True
        isJoinPoint _ = False

        match :: [E] -> [([HsPat],E->E)] -> E -> C E
        -- when we run out of arguments, we should run out of patterns. simply fold the transformers.
        match  [] ps err = return $ foldr f err ps where f (~[],fe) err = fe err
        -- when we are out of patterns, return the error term
        match _ [] err = return err
        match ~(b:bs) ps err = do
            (b',mf) <- if isEVar b then return (b,id) else do
                [ev] <- newVars [getType b]
                return $ (EVar ev, eLet ev b)
            pps <- tidyHeads b' ps
            let patternGroups = groupUnder (isHsPWildCard . fst3) pps
                f [] err = return err
                f (ps:pss) err = do
                    err' <- f pss err
                    if isEVar err' || isEError err' || isJoinPoint err' then matchGroup b' bs ps err' else do
                        [ev] <- newVars [EPi tvr { tvrType = unboxedTyUnit } $ getType err']
                        let ev' = setProperties [prop_ONESHOT, prop_JOINPOINT] ev
                        nm <- matchGroup b' bs ps (EAp (EVar ev') unboxedUnit)
                        return $ eLetRec [(ev',ELam (setProperty prop_ONESHOT tvr { tvrType = unboxedTyUnit }) err')] nm
            liftM mf $ f patternGroups err
        matchGroup b bs ps err
            | all (isHsPWildCard . fst3) ps = match bs [ (ps,e) | (_,ps,e) <- ps] err
            | Just () <- mapM_ (fromHsPLitInt . fst3) ps = do
                let tb = getType b
                (lbv,bv) <- varify b
                let gps = [ (p,[ (ps,e) |  (_,ps,e) <- xs ]) | (p,xs) <- sortGroupUnderF fst3 ps]
                    eq = EAp (func_equals funcs) tb
                    f els (HsPLit (HsInt i),ps) = do
                        let ip | abs i > integer_cutoff  = (EAp (EAp fromInteger tb) (intConvert i))
                               | otherwise =  (EAp (EAp fromInt tb) (intConvert i))
                        m <- match bs ps err
                        createIf (EAp (EAp eq bv) ip) m els
                    f els ~(HsPLit (HsFrac i),ps) = do
                        let ip = (EAp (EAp fromRational tb) (toE i))
                        m <- match bs ps err
                        createIf (EAp (EAp eq bv) ip) m els
                e <- foldlM f err gps
                return $ lbv e
            | all (isHsPString . fst3) ps = do
                (lbv,bv) <- varify b
                (eqString,_,_) <- convertValue v_eqString
                (eqUnpackedString,_,_) <- convertValue v_eqUnpackedString
                let gps = [ (p,[ (ps,fe) |  (_,ps,fe) <- xs ]) | (p,xs) <- sortGroupUnderF fst3 ps]
                    f els (HsPLit (HsString ""),ps) = do
                        m <- match bs ps err
                        return $ eCase bv [Alt (litCons { litName = dc_EmptyList, litType = tString }) m] els
                    f els ~(HsPLit (HsString s),ps) = do
                        m <- match bs ps err
                        let (s',packed) = packupString s
                        if packed
                            then return $ ifzh (EAp (EAp (EVar eqUnpackedString) s') bv) m els
                            else return $ ifzh (EAp (EAp (EVar eqString) s') bv) m els
                e <- foldlM f err gps
                return $ lbv e
            | all (isHsPLit . fst3) ps = do
                let gps = [ (p,[ (ps,fe) |  (_,ps,fe) <- xs ]) | (p,xs) <- sortGroupUnderF fst3 ps]
                    f (~(HsPLit l),ps) = do
                        m <- match bs ps err
                        return (Alt (litconvert l (getType b)) m)
                as@(_:_) <- mapM f gps
                [TVr { tvrIdent = vr }] <- newVars [Unknown]
                return $ unbox dataTable b vr $ \tvr -> eCase tvr as err
            | Just ps <- mapM pappConvert ps = do
                let gps =  sortGroupUnderF (hsPatName . fst3) ps
                    (Just patCons) = getConstructor (toName DataConstructor $ fst $ head gps) dataTable
                    f (name,ps) = do
                        let spats = hsPatPats $ fst3 (head ps)
                            _nargs = length spats
                        vs <- newVars (slotTypesHs dataTable (toName DataConstructor name) (getType b))
                        ps' <- mapM pp ps
                        m <- match (map EVar vs ++ bs) ps' err
                        deconstructionExpression dataTable (toName DataConstructor name) (getType b) vs m
                    pp (~(HsPApp n ps),rps,e)  = do
                        return $ (ps ++ rps , e)
                as@(_:_) <- mapM f gps
                case conVirtual patCons of
                    Nothing -> return $ eCase b as err
                    Just sibs -> do
                        let (Just Constructor { conChildren = DataNormal [vCons] }) = getConstructor (conInhabits patCons) dataTable
                            (Just Constructor { conOrigSlots = [SlotNormal rtype] }) = getConstructor vCons dataTable
                        [z] <- newVars [rtype]
                        let err' = if length sibs <= length as then Unknown else err
                        return $ eCase b [Alt litCons { litName = vCons, litArgs = [z], litType = getType b } (eCase (EVar z) as err')] Unknown
            | otherwise = error $ "Heterogenious list: " ++ show (map fst3 ps)
        pappConvert (p@HsPApp {},x,y) = return (p,x,y)
        pappConvert (HsPLit (HsString ""),ps,b) = return (HsPApp dc_EmptyList [],ps,b)
        pappConvert (HsPLit (HsString (c:cs)),ps,b) = return (HsPApp dc_Cons [HsPLit (HsChar c),HsPLit (HsString cs)],ps,b)
        pappConvert _ = fail "pappConvert"
        isHsPString (HsPLit HsString {}) = True
        isHsPString _ = False
    match bs ms err

packupString :: String -> (E,Bool)
packupString s | all (\c -> c > '\NUL' && c <= '\xff') s = (EPrim (PrimString (packString s)) [] r_bits_ptr_,True)
packupString s = (toE s,False)

actuallySpecializeE :: Monad m
    => E   -- ^ the general expression
    -> E   -- ^ the specific type
    -> m E -- ^ the specialized value
actuallySpecializeE ge st = do
    -- trace (pprint (ge, getType ge, st)) $ return ()
    liftM (foldl EAp ge)
          (specializeE (getType ge) st)

specializeE :: Monad m
    => E   -- ^ the general type
    -> E   -- ^ the specific type
    -> m [E]  -- ^ what to apply the general type to to get the specific one
specializeE gt st = do
    let f zs x | Just mm <- match (const Nothing) zs x st = mapM (g mm) (reverse zs) where
            g mm tvr = case lookup tvr mm of
                Just x -> return x
                Nothing -> fail $ "specializeE: variable not bound: " ++ pprint (((gt,st),(mm,tvr)),(zs,x))
        f zs (EPi vbind exp) = f (vbind:zs) exp
        f _ _ = fail $ render (text "specializeE: attempt to specialize types that do not unify:"
                               <$> pprint (gt,st)
                               <$> tshow  gt
                               <$> tshow st)
    f [] gt

procAllSpecs :: Monad m => DataTable -> [Type.Rule] -> [(TVr,E)] -> m ([(TVr,E)],Rules)
procAllSpecs dataTable rs ds = do
    let specMap = Map.fromListWith (++) [ (toId n,[r]) | r@Type.RuleSpec { Type.ruleName = n } <- rs]
        f (t,e) | Just rs <- Map.lookup (tvrIdent t) specMap = do
            hs <- mapM (makeSpec dataTable (t,e)) rs
            return (unzip hs)
        f _ = return mempty
    (nds,rules) <- mconcat `liftM` mapM f ds
    return $ (nds,fromRules rules)

makeSpec :: Monad m => DataTable -> (TVr,E) -> T.Rule -> m ((TVr,E),Rule)
makeSpec dataTable (t,e) T.RuleSpec { T.ruleType = rt, T.ruleUniq = (m,ui), T.ruleSuper = ss } = do
    let nt = removeNewtypes dataTable $ tipe rt
    as <- specializeE (getType t) nt
    let ntvr = tvr { tvrIdent = toId newName, tvrType = getType nbody, tvrInfo = setProperties (prop_SPECIALIZATION:sspec) mempty }
        Just nn = fromId (tvrIdent t)
        (ntype,Just (show -> m),q) = nameParts nn
        newName = toName ntype (Just $ toModule ("Spec@." ++ m ++ "." ++ show ui),'f':m ++ "." ++ q)
        sspec = if ss then [prop_SUPERSPECIALIZE] else []
        ar = makeRule ("Specialize.{" ++ show newName) (toModule m,ui) RuleSpecialization bvars t as (foldl eAp (EVar ntvr) (map EVar bvars))
        bvars = nub $ freeVars as
        nbody = foldr ELam (foldl EAp e as) bvars
    return ((ntvr,nbody),ar)
makeSpec _ _ _ = fail "E.FromHs.makeSpec: invalid specialization"

deNewtype :: DataTable -> E -> E
deNewtype dataTable e = removeNewtypes dataTable (f e) where
    f ECase { eCaseScrutinee = e, eCaseAlts = ((Alt (LitCons { litName = n, litArgs = [v], litType = t }) z):_) } | alias == DataAlias ErasedAlias = f (eLet v e z) where
        Identity Constructor { conChildren = alias } = getConstructor n dataTable
    f ECase { eCaseScrutinee = e, eCaseAlts =  ((Alt (LitCons { litName = n, litArgs = [v], litType = t }) z):_) } | alias == DataAlias RecursiveAlias = f $ eLet v (prim_unsafeCoerce e (getType v)) z where
        Identity Constructor { conChildren = alias } = getConstructor n dataTable
    f e = runIdentity $ emapE (return . f) e

ffiTypeInfo bad t cont = do
    dataTable <- getDataTable
    case lookupExtTypeInfo dataTable t of
        Just r -> cont r
        Nothing -> do
            sl <- getSrcLoc
            liftIO $ warn sl InvalidDecl $ printf "Type '%s' cannot be used in a foreign declaration" (pprint t :: String)
            return bad

unboxedVersion t = do
    ffiTypeInfo Unknown t $ \eti -> case eti of
        ExtTypeBoxed _ uv _ -> return uv
        ExtTypeRaw _ -> return t
        ExtTypeVoid -> return (eTuple' [])

marshallToC e te = do
    ffiTypeInfo Unknown te $ \eti -> do
    case eti of
        ExtTypeBoxed cna sta _ -> do
            [tvra] <- newVars [sta]
            return $ eCase e
                           [Alt (litCons { litName = cna, litArgs = [tvra], litType = te })
                                (EVar tvra)]
                           Unknown
        ExtTypeRaw _ -> return e
        ExtTypeVoid -> fail "marshallToC: trying to marshall void"
marshallFromC ce te = do
    ffiTypeInfo Unknown te $ \eti -> do
    case eti of
        ExtTypeBoxed cna _ _ -> return $ ELit (litCons { litName = cna, litArgs = [ce], litType = te })
        ExtTypeRaw _ -> return ce
        ExtTypeVoid -> fail "marshallFromC: trying to marshall void"

extractUnboxedTup :: E -> ([E] -> C E) -> C E
extractUnboxedTup e f = do
    vs <- newVars $ concat (fromTuple_ (getType e))
    a <- f (map EVar vs)
    return $ eCaseTup' e vs a


text:
Bill & Frank die together in Episode 3 – Hollywood Life
/ The 7 Best Cruises from New York City 2023: Iconic transatlantic crossings, dreamy island hopping and adventurous Arctic voyages
The 7 Best Cruises from New York City 2023: Iconic transatlantic crossings, dreamy island hopping and adventurous Arctic voyages
There's nothing quite like joining one of the many cruises departing from New York City, leaving the Statue of Liberty and famous skyline behind for an adventure you'll never forget after wandering some of the world's most iconic streets are. New York is also home to the oldest cruise ship terminal in the United States. Today there are two hubs, one in Manhattan and one in Brooklyn. An additional cruise terminal at Cape Liberty in Bayonne, New Jersey also serves the area.
Manhattan's cruise terminal is on the edge of Midtown, making it easy to spend days in port or pre-cruise exploring Times Square, Central Park, or the Theater District. The Empire State Building and famous department stores like Macy's Herald Square are also within walking distance of Manhattan's cruise port.
Brooklyn Cruise Port is a 15-minute drive from Brooklyn Bridge Park, which offers some of the best views of downtown Manhattan. If you want to stretch your legs, the walk across the Brooklyn Bridge into Manhattan offers just over a mile of scenic city views.
While Bayonne, New Jersey might not be a big destination, sailing Cape Liberty offers picture-perfect views of the Manhattan skyline and its famous neighbor, the Statue of Liberty.
Which cruise ships depart from New York?
Both large cruise ships and a few smaller ships depart from New York, giving you the option of choosing a ship with lots of restaurants and lounges, or a more leisurely one with fewer dining options. A variety of cruise lines – including Norwegian Cruise Line, MSC, Holland America, Disney, Cunard, Silversea, Oceania Cruises and Viking – depart from New York City. The variety caters to all types of travelers, whether you want to take a cruise from New York for just a few hundred bucks or buck thousands for a bucket-list vacation.
Where do cruises depart from New York?
Cruises from New York sail to Canada, Greenland, Iceland, Europe, the UK, Bermuda, the Caribbean and beyond. Several world cruises also stop in New York.
The moral of the story is, whether it's a short island escape or the trip of a lifetime, a cruise from New York will make PTO well spent. We've selected ahead of time some of your best options for cruising from New York City.
All products featured on Condé Nast Traveler are independently selected by our editors. However, if you purchase something through our retail links, we may earn an affiliate commission.
The Disney Magic cruise ship sails on the Hudson River
Gary Hershorn/Getty
Best short cruise from New York
If you only have a few days, consider Bermuda. Several cruise lines, including Disney, Royal Caribbean, and Norwegian Cruise Line, offer four- and five-night cruises from New York to Bermuda. It may take a full day to sail from New York to Bermuda, but there are few more relaxing ways to start or end a cruise than with a relaxing day at sea. Choose a four-night cruise if you're short on time, or a five-night cruise for a little more time exploring Bermuda's pink sand beaches.
Best long cruise from New York
Perhaps the only thing better than leaving New York is heading back to the Big Apple after the adventure of a lifetime. Oceania's 51-night Epic Northern Hemisphere Cruise, scheduled for summer 2024, will surely tick the box. The cruise stops at classic American summer vacation spots like Bar Harbor in Maine and Newport before heading to Greenland, Iceland and several ports in continental Europe. Spend port days exploring cities like Amsterdam, Paris, Dublin, and Belfast before making your way back to New York City. The Insignia planned for this route can accommodate almost 700 passengers. Onboard facilities include shuffleboard, putting greens, a fitness center, spa and salon.
Best family cruise from New York
Cruise from New York to Bermuda and back on a four to six night cruise aboard the Disney Dream. One of the larger ships in Disney's fleet, the Dream is sure to keep your kids busy with miniature golf, water features and sports fields galore. There is also a live performance theater and cinema on board. The Disney Dream offers space for a maximum of 4,000 passengers in its 1,250 cabins. Inspired by 1930s passenger ships, the ship features a black hull and twin red funnels. Minor touches include a statue in the lobby celebrating the one and only Donald Duck.
Best Fall Foliage Cruise from New York
There are few better ways to experience the fall foliage than driving along the East Coast in the fall. Seabourn offers a 12-day fall foliage cruise from New York calling at ports in Rhode, Island, Maine and Quebec. The itinerary includes an overnight stay in Halifax, Nova Scotia before ending in Montreal. This cruise departs from New York on the day of embarkation, so you may want to arrive a few days early to explore the city before your cruise.
Best Transatlantic Cruise from New York
When it comes to transatlantic sailing, Cunard sets the standard. The legendary Queen Mary II sails between Brooklyn and Southampton in southern England – and you can even bring your pup on board. The Queen Mary II comes with kennel space, although advance booking is recommended as this is limited. You should also pack a suit jacket and tie or evening dress as some onboard facilities require formal attire. Prepare for many sea days and some potentially rough waters; A minimum of six days at sea is required for each transatlantic crossing from Cunard.
A Regent Seven Seas ship sails through Venice
Best Northern Europe Cruise from New York
For an unforgettable adventure across Canada, Greenland and Iceland, join the Regent Seven Seas, cruising from Manhattan to northern Europe in 18 nights. This cruise from New York stops at the summer hotspots of Martha's Vineyard before continuing to Saint John and Halifax, Canada, en route to Greenland and Iceland. This cruise makes three stops in Greenland and two stops in Iceland. The voyage takes only three days at sea, the first of which should be a welcome rest day after several days in port.
Best Mediterranean Cruise from New York
Sail from Manhattan to Bermuda, Portugal, Spain, southern France and Italy in just 16 nights on Norwegian Breakaway, a ship that seats just over 4,000 passengers and is sure to have something for everyone. Norwegian Breakaway offers multiple onboard restaurants and lounges, as well as Broadway shows, five tiered waterslides and the largest high ropes course at sea. During her Mediterranean cruise, Norwegian Breakaway calls at Lisbon, Malaga, Barcelona, Cannes and Rome.
Rolling Stone snubs Celine Dion and fans call…
What to Expect from the Creator Economy in…
Golden Gate Bridge suicide web could…
Brazil Sends First-Ever Shipment Of Corn…
Egyptian startup OneOrder sets course for…
Roasted Pumpkin Vampire Tacos recipe
Foods January 6, 2023
Ukraine War: Russian military airfields hit…
Damar Hamlin's collapse underscores black men's…
Science January 7, 2023
Revel in London
Travel December 6, 2022
Dodgers split with Trevor Bauer, star…
US News January 7, 2023
Ted Danson honors 'brilliant' Cheers co-star…
Researchers discover toxic process with 'jumping…
Kirstie Alley's ex Parker Stevenson pays…
Ronzoni's pastina is being discontinued and…
LA County caregivers for elderly, disabled…
Scott Van Pelts Winner for the…
Sports January 8, 2023
Best gifts for grandparents in 2022
Can Intermittent Fasting Change How Your DNA Works?
25 questions with Dr. Mercola | FULL VERSION He may be a bestselling author and one of the most visited doctors…
Uncertainty for home seekers amid rapidly changing guidelines
Donovan Henry was relaxing in his Long Beach motel room on Wednesday when he received a panicked text message. It was…
How Acura created the ARX-06 race car that won…
The Acura ARX-06 claimed the first win of IMSA's LMDh prototype era at the 2023 Rolex 24 at Daytona. Ahead of…

redpajama_set_name: RedPajamaCommonCrawl


text:
RapidAI Achieves Record Momentum Amid Demand for Improved Clinical Decision Making and Patient Workflow
Leader in neurovascular and vascular imaging analysis gains worldwide momentum with extended NTAP reimbursement, record number of scans, product innovation, new partnerships, and influential board members
San Mateo, Calif. — August 19, 2021 — RapidAI, the global leader in neurovascular and vascular imaging driving the next evolution of clinical decision making and patient workflow, today announced record corporate momentum with more than 2.8M scans to date on its platform — the most clinically advanced in the industry.
The COVID-19 pandemic has increased providers' need for technology that brings together previously disconnected care teams. Now in use at more than 1,800 hospitals across 60 countries — including 18 of the top 20 in U.S. News' 2020-21 Best Hospitals report — hospitals deploying RapidAI are automating workflows and improving communications to enable quicker triage and treatment.
"We continue to be laser-focused on bringing advanced solutions to improve patient care," said Don Listwin, CEO of RapidAI. "As we build significant relationships with our customers and leading organizations, and gain certifications that further validate our platform, we are excited not just about the momentum we have achieved, but also the opportunity to redefine the patient care journey with AI."
As the global leader using AI to combat life-threatening conditions, RapidAI has achieved the following since the start of 2021:
Extended NTAP reimbursement - The New Technology Add-on Payment (NTAP) for Rapid LVO was recently renewed based on its demonstrated ability to increase access to care, save time, and improve outcomes. NTAP is an additional Medicare reimbursement that financially assists healthcare organizations when they adopt new technology.
Record number of scans – RapidAI has seen substantial growth in the number of scans processed on its platform, reaching more than 2.8M to date.
In the first half of 2021 alone, the platform saw nearly 1 million scans from over 500,000 patients around the world, approximately two scans every minute since the start of the year.
Product innovation – Building on its platform for stroke and aneurysm, which combined, have more FDA clearances than any other company in this space, RapidAI has expanded its portfolio to address prehospital stroke care and pulmonary embolism.
Introduced in June, Rapid Workflow for PE, is a product designed to align hospital teams on the treatment of patients suspected of having a pulmonary embolism.
The Rapid for Prehospital mobile app, launched in May, helps EMS and hospitals follow a standardized stroke protocol that streamlines data collection and improves collaboration while en route to an appropriate hospital.
Impactful global partnerships – The recently launched Rapid Workflow for PE is a product of the partnership with Penumbra, Inc., a global healthcare company focused on innovative therapies to treat ischemic stroke and vascular blood clots. Additionally, RapidAI recently partnered with Stryker in the US to deliver flexible financing solutions, offering RapidAI stroke and aneurysm imaging software with Stryker neurovascular devices.
The company also expanded global partnerships in Latin America, as the exclusive neuroimaging partner for the new Stroke Center Certification Program through a partnership with the World Stroke Organization (WSO), as well as in Australia, having secured TGA clearance for the Rapid stroke imaging platform and now serving more than 50 hospitals and teleradiology services across the country.
Bolstered board membership – RapidAI has also recently added two new board members, Dr. Hadi Saleh, CEO of the CeramTec Group and John Drew, General Partner, TCV.z
"It's critical that healthcare providers have reliable real-time clinical data from the very earliest stages of patient care to make informed decisions and communicate efficiently," said Alejandro Spiotta, M.D., Medical University of South Carolina Division of Neuroendovascular Surgery Director. "With time being so critical, an advanced platform like RapidAI's is essential to streamline patient workflow and improve communications across the entire care team."
With many new products on the horizon, RapidAI is poised to continue its growth and lead the way in helping hospitals transform patient care for life-threatening conditions.
Cara Masessa
Merritt Group
rapidai@merrittgrp.com


Principles of effective long-term condition management, including pathophysiological concepts, for assessing the impact of chronic conditions and application with best practice clinical guidelines. Early detection, practice-based resources, patient self-management, and end of life care are addressed.
This paper explores the concept of long-term condition management and the nurse's role within the interdisciplinary team. The focus is on the promotion of population health monitoring and evaluating the effectiveness of risk reduction. The aim of this paper is to support individuals in reducing the risk of developing long-term conditions. The paper also addresses the needs of those with existing long-term conditions, and a key focus is on improving the patient journey through integrated care models and self-management strategies.
The paper covers a general background of long-term conditions and the underlying pathophysiology. There is an exploration of models, concepts and recent innovations in this area. It is underpinned by evidence-based practice. A range of subject areas that are significant are covered in more depth, for example: diabetes, cardiovascular disease (CVD) and respiratory health.
The paper is focused toward Nurse Prescribing for Long-Term Conditions in order to meet the Nursing Council of New Zealand requirements and Educational Standards as published (NCNZ 2016).
Craft & Gordon (2015). Understanding Pathophysiology (2nd ed.), Elsevier.
National Advisory Committee on Health and Disability.
conditions (2nd ed.). Wellington: Ministry of Health.
Interdisciplinary perspective, Critical thinking, Cultural understanding, Ethics, Information literacy, Research, Self-motivation, Teamwork.


ARM & HAMMER™ food grade bicarbonate products offer uses in addition to leavening, from aesthetic enhancements to additional applications. For example, Flow K™ potassium bicarbonate enhances browning and highlights the toasted and grainy flavor notes of certain recipes. It is also an effective effervescent for drink mixes, and has been observed to enhance sweetening. Another example is ammonium bicarbonate's usefulness as a processing aid, as it increases dough pH to effect browning; and later returns pH to neutral at the end of the baking process.


Halogen is an industrial inspired all caps font.
It looks strong, bold and powerful with a little of retro style. Keep in mind that it is in all caps, so you it's preferred you use it for titles, tag lines and headings mainly.
Designed by Jeremy Uessey exclusively for Pixel Surplus.


Prepare yourself for a role as a travel consultant by learning about the latest travel trends.
Gain insight into the diverse range of travel styles and types within the tourism industry. Through hotel inspections, travel industry presenters and our course content, you will gain a deeper understanding of airlines, cruises, tours and hotels. In this course, we share current and valuable Flight Centre insights with you, gained from over 20 years in the business!


Pursuant to Arizona Revised Statute, A.R.S. §§ 39-121, 39-121.01, and 39-121.03 specific and identifiable public records are to be made available to the public for inspection and copying.
What is a Public Record Request?
A valid public record request is for a specific and identifiable public document. The document is identified so a staff person of the agency is able to locate responsive documents. Identification includes any combination of the following information: name of document, subject matter, date, location, persons involved, specific incident, etc.
Note: Requests for information that does not currently exist or which may require the production of creating new reports may not be accommodated.
ii. If it is a former juvenile over the age of 18, a signed release by the juvenile.
Documentation establishing your authority to request and obtain the copies requested, such as a court order.
What records are not considered public?
The Arizona Department of Juvenile Corrections (ADJC) releases information on juveniles only to criminal justice agencies, their staff, and/or other selected agencies, or approved persons on a need-to-know basis in compliance with state statutes, regulations, and applicable federal laws and regulations.
Information regarding specific juveniles shall be released to the public only with the proper authorization or by court order or as authorized by A.R.S. § 8-208. If a public record does contain personally identifiable information, such information will be redacted prior to being made available to the requestor.
What is the Department policy related to Public Records Requests?
See Policy 1120 and Procedure 1120.01 et seq.
There is no charge to view public records. Copies of public records for non-commercial use are available for 10 cents per page. This charge applies whether the copies are on paper or electronic. Depending on the information requested, there may be a $10/hour labor charge.
Email Request To: James Mapp, ADJC Public Records, at [email protected].
For media inquiries, please contact Melissa Jo Watkins, Government and Public Affairs Administrator at (602) 542-2564 or [email protected].


text:
Beagles & Books
a blog featuring reviews of children's literature
Blog Tour, Giveaway, Picture Books
Blog Tour & Giveaway: It's Not Hansel & Gretel by Josh Funk Illustrated by Edwardian Taylor
February 27, 2019 March 6, 2019 lauramossa
Beagles and Books is excited to be a part of the blog tour for It's Not Hansel and Gretel. It celebrates its book birthday on March 1, 2019. Special thanks to Two Lions Publishing and Barbara Fisch of Blue Slip Media for sending me a copy in exchange for an honest review. All opinions are my own.
An all-knowing narrator attempts to tell the traditional tale of Hansel and Gretel but is quickly interrupted by the characters who have their own idea of their story. For example, Gretel rebuts the notion that her parents wanted to get rid of her and her brother; rather, they are just taking a leisurely afternoon walk in the woods. When the siblings meet the witch, Gretel dismisses this label and refers to her as a sweet old lady. What makes my heart happy is Gretel's championing of women's rights with her insistence in changing the title to Gretel and Hansel and arguing about why her brother gets candy and she is stuck doing chores. "Get with the times-this is the fifteenth century," she retorts!
Fed up with Gretel's & Hansel's (you're welcome, Gretel) antics, the narrator turns the storytelling over to them which allows the duo to get creative growing mustaches, getting a pet unicorn named Fluffybottom, and opening up a bakery serving delicious sweets to their fellow fairy tale friends.
For fans of It's Not Jack and the Beanstalk, It's Not Hansel and Gretel is a hilarious and worthy follow up. Funk's witty writing is pure joy to read aloud and honestly, I find it difficult to not laugh myself. Taylor's illustrations are so entertaining and chocked full of details that I reread the story just to view his comical digital art. And look closely for cameos from characters from It's Not Jack and the Beanstalk!
If like me, you can't wait for more fractured fairy tales from the amazing collaborative team of Josh Funk and Edwardian Taylor, you will be thrilled to hear that It's Not Little Red Riding Hood is set for release in February 2020. For more info, click here.
Check out the book trailer!
Like Hansel and Gretel, Josh Funk doesn't like being told how stories should go—so he writes his own. He is the author of a bunch of picture books, including the popular Lady Pancake & Sir French Toast series, illustrated by Brendan Kearney, and recently, How to Code a Sandcastle, illustrated by Sara Palacios, and Lost in the Library: A Story of Patience & Fortitude, illustrated by Stevie Lewis. He lives in New England with his wife and children. Learn more about him at www.joshfunkbooks.com and follow him on Twitter @joshfunkbooks.
Edwardian Taylor has worked as a visual development artist and character designer in the game and animation industry. He illustrated the picture book Race!, written by Sue Fliess and the chapter book Toy Academy: Some Assembly Required, written by Brian Lynch. He lives in Texas with his partner and their four dogs. Learn more about him at www.edwardiantaylor.com and follow him on Tumblr, Instagram, and Twitter @edwardiantaylor.
Two Lions is offering one copy of IT'S NOT HANSEL AND GRETEL to one lucky winner (U.S. addresses) Giveaway begins Wednesday, February 27, 2019 and ends at 12:00 a.m. on Saturday, March 9, 2019. Good luck!
#Bookexcursion, Giveaway, It's Monday! What Are You Reading?, Picture Books
It's Monday! What Are You Reading? 2/18/19
February 18, 2019 February 18, 2019 lauramossa
Beagles and Books is excited to share another edition of It's Monday! What Are You Reading? #IMWAYR is a community of bloggers who link up to share what they are reading. Kellee Moye of Unleashing Readers and Jen Vincent of Teach Mentor Texts decided to give it a #kidlit focus and encourage everyone who participates to visit at least 3 of the other #kidlit book bloggers that link up and leave comments for them.
Our Recent Reads:
Cogheart by Peter Benzl
Cogheart tells the story of Lily, a student at Miss Octavia Scrimshaw's Finishing Academy for Young Ladies. Posture class and French conversation lessons are not Lily's cup of tea and while she may have frustrated a number of her governesses, she still can't understand why her inventor father, John Hartman send her to boarding school under a false surname.
As the story quickly unfolds, Lily discovers that her father is missing after his airship crashed. Since he is presumed dead, Lily is plucked out of school by her father's housekeeper who Lily knows cannot be trusted. Determined to find her father, Lily puts her trust in Robert, the son of a town clockmaker who with his father's help repairs Malkin, Lily's mechanical fox after he was injured. Created by her father, Malkin shares his account of what happened on the airship the night John Hartman disappeared. As she, Robert, and Malkin navigate Victorian London thwarting off dastardly villains and attempt to uncover the truth, Lily discovers family secrets that could endanger Robert's and her lives.
Cogheart is a book I wished I had read when I was a kid. With dynamic characters, a fast paced intriguing plot, and an enchanting steampunk setting, I was quickly immersed in Lily and Robert's world. To read my full review and enter a giveaway for your own copy, click here.
Sweety by Andrea Zuill
Sweety is an uplifting story about celebrating uniqueness. Sporting glasses and braces and having a fondness for fungi, Sweety does not fit in even in the world of naked mole rats. Fortunately, Sweety is blessed with her Aunt Ruth who instills in her that being different is in fact pretty awesome. Author illustrator Andrea Zuill is quickly becoming a favorite storyteller of mine. With the support of family or close friends, her characters (Homer of Wolf Camp and Jasper of Business Pig) embrace their individuality, which is a great lesson for us all. Thanks to Random House for sending a F & G of Sweety to my #bookexcursion group. It releases next month on March 26, 2019.
Waiting for Pumpsie by Barry Wittenstein Illustrated by London Ladd
Since Jackie Robinson broke the color barrier as the first American African Major League baseball player in 1947, I assumed that all other teams followed their lead soon after. Barry Wittenstein's fictional account, Waiting for Pumpsie taught me differently. Finding age appropriate text to teach elementary students about the history of race relations can be challenging. Wittenstein's narrative which tells the true story of African-American rise to Major League Baseball is a must read because it provides an accurate and accessible account of the history of racial segregation and fight for integration for this age group. Children can easily relate to his Bernard's disappointment as well as his hope and enthusiasm. To read my full review and enter a giveaway for your own copy, click here.
Wanting to spread the dog love, Beagles and Books has a weekly feature of highlighting a literary selection with a canine main character.
Good Boy by Sergio Ruzzier
Written using only verbs, Good Boy tells the story of a boy and his dog. At first, the boy gives his pup simple commands such as sit, stay, and roll over. The boy's commands become more unconventional asking his furry best friend to stand, juggle, cook, pedal, sail and build, which the dog has no difficulties fulfilling. After collaborating to build a spaceship, the duo blast off to another planet to interact with aliens. Once they get home and get ready for bed, the boy repeats his command of stay which ends with the best friends snuggling in bed for the night.
I am a huge fan of Sergio Ruzzier, for his words and artwork exudes warmth and whimsy. What I love most about Good Boy is with its concise text and charming pen and watercolor illustrations, Ruzzier beautifully captures the genuine love between a boy and his dog. Thanks to Sergio Ruzzier and Julia McCarthy of Atheneum/Simon and Schuster for sending a F & G of Good Boy to my #bookexcursion group. Good Boy recently published on February 12, 2019.
Etta, Bella, and I thank you for stopping by Beagles and Books. Happy reading!
Giveaway, Picture Books
Review and Giveaway for Waiting for Pumpsie by Barry Wittenstein Illustrated by London Ladd
Beagles and Books is excited to share a review for Waiting for Pumpsie written by Barry Wittenstein and illustrated by London Ladd. Special thanks to Charlesbridge Publishing and Barbara Fisch of Blue Slip Media for sending me a copy in exchange for an honest review. All opinions are my own.
Publisher's Summary:
"Change is coming real soon."
In 1959 the Boston Red Sox was the last team in the Major Leagues to integrate. But when they call Elijah "Pumpsie" Green up from the minors, Bernard is overjoyed to see a black player on his beloved home team. And, when Pumpsie's first home game is scheduled, Bernard and his family head to Fenway Park. Bernard is proud of Pumpsie and hopeful that this historic event is the start of great change in America.
This fictionalized account captures the true story of baseball player Pumpsie Green's rise to the major leagues. The story is a snapshot of the Civil Rights Movement and a great discussion starter about the state of race relations in the United States today.
Since Jackie Robinson broke the color barrier as the first American African Major League baseball player in 1947, I assumed that all other teams followed their lead soon after. Barry Wittenstein's fictional account, Waiting for Pumpsie taught me differently.
It's 1959. Bernard is a huge Boston Red Sox fan but he cannot understand why his beloved team still doesn't have any African-American players on their roster. Jackie Robinson is already retired from the Dodgers for two years so why are the Red Sox dragging their feet? Through Bernard's narration, Wittenstein shares that while many baseball teams and fans were ready for integration, it was clear that the Boston Red Sox did not share the same sentiment. As the Red Sox plummet to last place in the standings, Bernard patiently waits and finally on a hot July day, Bernard's prayers are answered. Pumpsie Green is called up from the minors! Aware of this historic day in Boston baseball history, Bernard's father buys tickets for Pumpsie's first home game. Although the Sox did not win the game, Wittenstein's text and Ladd's illustrations on the last few pages beautifully convey Bernard's sheer excitement for being a part of that unforgettable day not only in Boston Red Sox history but also in his own life.
Finding age appropriate text to teach elementary students about the history of race relations can be challenging. Wittenstein's account is perfect because it provides an accurate and accessible account of the history of racial segregation and fight for integration for this age group. Because it is written from Bernard's point of view, children can easily relate to his disappointment as well as his hope and enthusiasm. Ladd's acrylic and colored pencil artwork truly transports readers to Fenway Park in the 1950's.
I highly recommend Waiting for Pumpsie as a read aloud and with the Wittenstein's author note, I am grateful to learn even more about "Pumpsie" Green and his role in fully integrating all Major League Baseball teams.
Praise for WAITING FOR PUMPSIE!
★"A grand slam." —Kirkus Reviews (starred review)
"Bernard's conversational narration creates a warm bond with readers from the get-go, and although Wittenstein and Ladd never sugarcoat instances of racial prejudice, the story's moments of triumph sound the loudest notes." —Publishers Weekly
Barry Wittenstein has tended bar, driven a taxi, worked at CBS Records and CBS News back in the day, spent a decade writing music and lyrics, toiled six years as a web editor and writer for Major League Baseball, and three years as a substitute elementary school teacher. He could be Walter Mitty's brother.
Barry loves to write narrative nonfiction picture books. He is the author of Waiting for Pumpsie and The Boo-Boos That Changed the World. In 2019, he will publish two more nonfiction picture books—Sonny's Bridge, about the legendary jazz saxophonist Sonny Rollins; and A Place to Land (with illustrations by Caldecott Medalist Jerry Pinkney) about how Martin Luther King Jr. wrote his "I Have a Dream" speech. He is currently working on a YA novel. He lives in New York City with his wife. To learn more, and to download free curriculum guides, visit his website: https://onedogwoof.com/ or follow him on Twitter: @bwittbooks
One lucky winner will receive a Giveaway begins Sunday, February 17 and ends at 12:00 a.m. on Sunday, Giveaway begins Sunday, February 24, 2019 and ends at 12:00 a.m. on Sunday, February, 24, 2019. Enter below.
Book Birthday, Giveaway, Middle Grade Literature
Review & Giveaway for Cogheart by Peter Benzl
Beagles and Books is excited to share a review for Cogheart by Peter Benzl. Special thanks to Jolly Fish Publishing and Barbara Fisch of Blue Slip Media for sending me a copy in exchange for an honest review. All opinions are my own.
Some secrets change the world in a heartbeat.
Lily's life is in mortal peril. Her father is missing and now silver-eyed men stalk her through the shadows. What could they want from her? With her friends—Robert, the clockmaker's son, and Malkin, her mechanical fox—Lily is plunged into a murky and menacing world. Too soon Lily realizes that those she holds dear may be the very ones to break her heart …
Cogheart is a book I wished I had read when I was a kid. With dynamic characters, a fast paced intriguing plot, and an enchanting steampunk setting, I was quickly immersed in Lily and Robert's world. While Lily's quest to find out the truth was riveting, I was equally drawn to Robert who initially lacked confidence in himself and a dreadful fear of heights. Due to his kindness and loyalty to Lily, Robert realizes that his father Thaddeus was right, for while is true that "no one conquers fear easily, it takes a brave heart to win great battles." Cogheart is a story about family, friendship, and finding out who you really are.
First published in the UK in 2016, Cogheart is the first novel in the trilogy. Thankful to Jolly Fish Press for purchasing the American rights to this thrilling series. I am anxiously anticipating more adventures with Lily and Robert in Book 2 Moonlocket, which will be released in Fall 2019 and Book 3 Sky Circus in Spring 2020.
Praise for COGHEART!
With great style and panache, the novel deftly winds through the intricacies of friendship and moral choice while maintaining a fun edge." —Publishers Weekly
"An exciting, fast-paced adventure." —Booklist
"Introduces dastardly villains, friendly mechanicals, and thrilling airship action. . . . with hair-raising and cinematic charm." —Kirkus Reviews
View the book trailer below and click here to download activities, discussion guides and much more!
Peter Bunzl grew up in London and lives there with his partner Michael. He is a BAFTA-award-winning animator, as well as a writer and filmmaker. To learn more, visit his website, peterbunzl.com or follow him on Twitter @peterbunzl or Instagram @peter_bunzl
One lucky winner will receive COGHEART courtesy of Jolly Fish Press (U.S. addresses).
Bookexcursion
When You Are Brave by Pat Zietlow Miller
February 12, 2019 lauramossa
When You Are Brave by Pat Zietlow Miller Illustrated by Eliza Wheeler
Fans of Wherever You Go written by Pat Zietlow Miller and illustrated by Eliza Wheeler will love their latest collaboration. When You are Brave is an inspiring story about how to find courage in the midst of change. The story follows a young girl moving with her family to a new house in another town. Miller's concise lyrical text and Wheeler's use of subdued color are equally somber and match the girl's trepidation as she embarks on her journey. Halfway through drive, the girl closes her eyes and visualizes a small light inside her. The light grows giving her wings and the power to believe in herself. Miller's words are uplifting and beautifully conveys the little girl's positivity and Wheeler's illustrations become vibrant and brilliant.
What I love about When You are Brave is that the girl reminds us that we have the courage inside of us. When times are tough, it is easy to forget about this inner strength that we might conceal. Taking a moment to pause and breathe is the key to letting go of your worries and realizing you can weather any storm.
Special thanks to author Pat Zietlow Miller for sending a F & G to my #bookexcursion group. Pre-order now, for When You Are Brave publishes soon on March 5, 2019.
The True History of Lyndie B. Hawkins by Gail Shepherd
Named after President Lyndon Baines Johnson, history enthusiast Lyndie Baines Hawkins is passionate about reading and researching to learn the truth. Discovering the truth about her own family. Well, that is not as easy. While Lyndie knows that her dad, a Vietnam veteran, lost his job, she still doesn't truly understand why her family had to sell their house and move in with her paternal grandparents. And to make matters worst, her grandmother Lady expects Lyndie to be her best self (Translation: a proper Southern girl) which does not match Lyndie's bold personality. And Lady will not let her beloved dog Hoopdee in the house because of his "houndy odor."
While Lyndie is aware that her family especially her dad is struggling, no one will talk to her about what is wrong. In fact, Lady makes Lyndie promise to never discuss the family with anyone. But when her father's smell of Aqua Velva is replaced by whiskey and he disappears for days, Lyndie knows her family is broken. Unable to confide in her best friend and eternal optimist Dawn, a school project with D.B., a boy from a local detention center living with Dawn's family provides Lyndie with the opportunity to uncover revelations not only about D.B.. These facts help Lyndie realize that while "there is such a thing as honorable lying," being loyal doesn't mean one has to be dishonest. Loyalty is about speaking up when it's hard and not keeping secrets that can hurt others.
The True History of Lyndie B. Hawkins blew me away. Author Grace Shepherd's debut novel is a must read, for she tackles tough issues with grace, sincerity, and humor. Lyndie's voice was so authentic and while she had my heart, because of Shepherd's outstanding character development, my heart broke for all the characters (even "keep up appearances" Lady). As I read, I discovered that everyone was fighting their battle alone afraid to admit their faults or fears and healing can only begin when we are willing to put our trust in others. Special thanks to Gail Shepherd for sharing an ARC with my #bookexcursion group. Pre-order now, for Lyndie publishes soon on March 5, 2019.
Arnold and Louise: The Great Louweezie by Erica S. Perl Illustrated by Chris Chatterton
Arnold, a brown bear, is quiet and cautious. Louise, a small chipmunk is adventurous. Although they don't have a lot in common, they are best friends. In the first book in the series, Louise has decided that she can predict the future and reinvents herself as the Great Louweezie. Arnold isn't that easily convinced. Can the Great Louweezie work some magic and change his mind?
With short chapters, adorably drawn illustrations, and an engaging plot, Arnold and Louise is a new series which will appeal to readers transitioning to chapter books. While Arnold and Louise have different personalities, it is clear that these best friends bring out the best in each other. Thanks to Penguin Kids for sharing Arnold and Louise with my #bookexcursion group. The Great Louweezie recently published in January. To find out about the other books in the series, click here.
The Good Egg by Jory John Illustrated by Pete Oswald
For fans of The Bad Seed, The Good Egg is an egg-tastic follow up! The main character is indeed a good egg always setting a good example by doing the right thing. The same cannot be said for his 11 carton mates who are rarely on their best behavior. But always being good can make an egg literally crack; therefore, he makes the decision to leave the carton to truly focus on himself. During his time away, he heals both physically and emotionally realizing that the key to happiness is to not worry about being egg-ceptional all the time.
I can't gush about The Good Egg enough! The adorable illustrations, the witty text with plenty of egg puns, and most importantly, the beautiful message about the importance of self-care. Pre-order now, for it releases this week on February 12, 2019. Special thanks to fellow literacy specialist Lisa Maucione for sharing her F & G with me that she received from the publisher Harper Collins.
Etta's & Bella's Dog Pick of the Week:
Don't Lick the Dog: Making Friends with Dogs by Wendy Wahman
My beagle girls are sweet and docile, but I still appreciate when people especially kids ask "Can I pet your dog?" This picture book is a great resource for teaching children how to properly approach a dog that they do not know. Author illustrator Wendy Wahman shares rules for how to meet a dog with a rhyming text and bold and eye catching illustrations. Tips cover etiquette for petting a dog and giving out treats. Advice is also provided for how to safely respond when a dog is exhibiting behavior that could be scary to a child such as licking, jumping or barking. What I love about this book is that it reminds kids that dogs aren't toys and like people, they have their own personalities. Boy is that true!
#Bookexcursion, Early Chapter Books, It's Monday! What Are You Reading?, Middle Grade Literature, Picture Books
It's Monday! What Are You Reading? 2/4/19
February 4, 2019 lauramossa
Fans of Wherever You Go written by Pat Zietlow Miller and illustrated by Eliza Wheeler will love their latest collaboration. When You are Brave is an inspiring story about how to be brave in the midst of change. The story follows a young girl moving with her family to a new house in another town. Miller's concise melodious text and Wheeler's use of subdued color are equally somber and match the girl's trepidation as she embarks on her journey. Halfway through drive, the girl closes her eyes and visualize a small light inside her. The light grows giving her wings and the power to believe in herself. Miller's words are uplifting and beautifully conveys the little girl's positivity and Wheeler's illustrations become vivid and brilliant.
Special thanks to author Pat Zietlow Miller for sending a F & G to my #bookexcursion group. When You Are Brave publishes soon on March 5, 2019.
Duck and Hippo: The Secret Valentine by Jonathan London Illustrated by Andrew Joyner
Like all the books in the Duck and Hippo series, the theme of friendship is at the center of the story. In The Secret Valentine, no one knows for sure who the mystery valentine is but all the animals have their suspicions. To read my full review and enter a giveaway, click here.
Wolf Camp by Andrea Zuill
I love books that are told from a dog's point of view. Homer is a dog but he feels wolfish at times. Curious about what it would be like to live as a real wolf, he cannot pass up the opportunity to enroll in Wolf Camp. After convincing his family, Homer attends Wolf Camp where he and other dogs learn the basics of how to be real wolves.
Homer soon discovers that the food and sleeping accommodations contrast his comfortable life at home but he sticks it out and becomes a honorary wolf by the end of camp. While Homer adjust backs to his dog life in his warm bed and electric blanket, his certificate hanging in his room and his howl show that he will always be a wolf at heart.
I can't wait to read this aloud to students. Kids will find humor in the text and illustrations especially as Homer shared his experiences at Wolf Camp. His letter home is hysterical! Special thanks to my fellow #bookexcursion member Lisa Maucione for recommending this wolf-tastic picture book.
Blog Tour & Giveaway: Duck and Hippo by Jonathan London Illustrated by Andrew Joyner
February 1, 2019 February 1, 2019 lauramossa
Beagles and Books is excited to be a part of the blog tour for Duck and Hippo: The Secret Valentine written by Jonathan London and illustrated by Andrew Joyner. It recently published in December 2018. Special thanks to Two Lions Publishing and Barbara Fisch of Blue Slip Media for sending me a copy in exchange for an honest review. All opinions are my own.
Join Duck, Hippo, and their friends as they uncover their secret valentines!
It's Valentine's Day, and something curious is going on. As the birds tweet their love songs, Hippo and his friends Elephant, Pig, and Turtle each receive mysterious, unsigned Valentine's Day cards. Hippo wonders if his is from Duck; Elephant and Turtle think theirs are from Pig; and Pig dreams that hers is from Turtle. The cards tell the friends to come to the park at four o'clock to meet their valentines—so they'll find out soon enough! As the clock ticks away, the friends wonder—and dream—about their valentines and make special preparations. But when they arrive…SURPRISE!
This Valentine's Day might not go exactly the way they expected, but one thing is certain: being friends with Duck and Hippo is always a special treat!
Review and Thoughts:
Like all the books in the Duck and Hippo series, the theme of friendship is at the center of the story. In The Secret Valentine, no one knows for sure who the mystery valentine is but all the animals have their suspicions. Astute readers though will be able to spy the character responsible, for illustrator Joyner has included some clues in his artwork. Another observation is all the animals take pride in wanting to look their very best for their secret valentine. Andrew Joyner's illustrations warmly capture all the animals' personalities and excitement as they prepare for the Valentine party in the park.
I have adopted a second grade class for #classroombookaday and I read them a picture book every day. Reading aloud The Secret Valentine was a lot of fun because author Jonathan London includes a lot of sound effects such as SCRUBBA-DUBBA-DUBBA as the animals receive their invitations and get ready for the party.
After reading aloud, I always ask them "What does the author want to teach us? Since we started teaching virtues as a whole school, the students make connections to previous virtues as well as the current. While students identified Duck as being kind and caring, one student looked at the classroom community chart and said "Duck was showing courtesy because he invited all the animals to the Valentine party, not just Hippo." Then another student said, "Actually, all the animals were polite because they brought gifts and shared them with each other."
The classroom teacher and I just looked at each other smiling. Every day, we both see the importance of reading aloud. Students are getting to see examples of positive virtues which will help them become better classmates, friends, and citizens. Here's hoping there are more Duck and Hippo adventures to come! This series is definitely becoming a class favorite!
Jonathan London is the author of more than one hundred children's books, including the Froggy series, illustrated by Frank Remkiewicz, which has sold more than fifteen million copies. Jonathan lives in Graton, California. Learn more at www.jonathan-london.net.
Andrew Joyner is an Australian illustrator and author whose work has been published in more than twenty-five countries. He has created the artwork for many picture books, and he is author and illustrator of a chapter book series about a warthog named Boris. Andrew lives in South Australia. Learn more at www.andrewjoyner.com.au.
Learn how to draw Duck and Hippo in this free downloadable activity page! https://www.andrewjoyner.com.au/activities/.
The fourth book in the Duck and Hippo series is a sweet way to celebrate Valentine's Day! Check out the trailer!
One lucky winner will receive a copy of DUCK AND HIPPO: THE SECRET VALENTINE courtesy of Two Lions (U.S. addresses). Giveaway begins Friday, February 1, 2019 and ends at 12:00 a.m. on Friday, February 8, 2019. Good luck!
Follow Beagles & Books on WordPress.com
#MustReadsin2020
It's Monday! What Are You Reading?
#Bookexcursion
Middle Grade Literature
#BitAboutBooks Winter Challenge
#IMWAYR
#pb10for10
#nf10for10
#ReadYourWorld
Edelweiss+


text:
With worldwide sales of more than 75 million records, Barry Manilow's success is a benchmark in popular music. His concerts and night-club performances sell out instantly. He is ranked as the top Adult Contemporary chart artist of all time, according to Radio&Records and Billboard magazines. Rolling Stone crowned him "a giant among entertainers… the showman of our generation," and Frank Sinatra summed up Manilow best when Ol' Blue Eyes told the British press, "He's next." His list of Top 40 hits includes "Mandy," "It's A Miracle," "Could It Be Magic," "I Write the Songs," "Tryin' To Get the Feeling Again," "This One's For You," "Weekend In New England," "Looks Like We Made It," "Can't Smile Without You," "Even Now," and the Grammy Award-winning "Copacabana (At the Copa)."
Barry Manilow's Homepage
6' 1" White Conservatory Collection Grand Piano
DC3 PE
6' 1" Disklavier Concert Grand Piano
DGT7A
4' 11" Disklavier GranTouch Digital Grand Piano
MOTIF ES6
61 Key Music Production Synthesizer Workstation


Suppose I have a percent repeat. I'd like to place a bowing mark above it. (I realize this isn't strictly "correct" perhaps.) Is there a way to do that? My guess to the most promising approach is to use the \makePercent isolated repeat from http://lilypond.org/doc/v2.19/Documentation/notation/short-repeats, but I don't know how to get it to work.
For example, in the document below, I'd like an upbow over the percent in measure 2. How can I get that? The \upbow on the s1 that's in there now doesn't work.
"Make a percent repeat the same length as NOTE."


text:
Volta Redonda, amtlich Município de Volta Redonda, ist eine Großstadt im brasilianischen Bundesstaat Rio de Janeiro. Die Bevölkerung wurde zum 1. Juli 2018 auf 271.998 Einwohner geschätzt, die auf 182 km² (davon 82 km² urban) leben. Die Stadt liegt rund 130 km nordwestlich der Hauptstadt Rio de Janeiro.

Der Name der Stadt stammt vom kurvenförmigen Verlauf des Flusses Paraíba do Sul, an dem die Stadt erbaut wurde.

Die Nachbargemeinden von Volta Redonda sind Barra do Piraí, Barra Mansa, Pinheiral, Piraí und Rio Claro.

Volta Redonda ist Sitz des Bistums Barra do Piraí-Volta Redonda.

Entwicklung und Wirtschaft

Volta Redonda liegt im Vale do Paraíba, einer der wirtschaftsstärksten Regionen in Brasilien. Seit etwa Mitte des 18. Jahrhunderts wurde in der Region Landwirtschaft betrieben. Ursprünglich Kaffeeanbau, nach der Abschaffung der Sklaverei im Jahre 1888 vermehrt Viehzucht. Der Fluss spielte hier als Transportweg eine besondere Rolle.

Die Stadt in ihrer heutigen Form nahm ihren Anfang 1941, als die Companhia Siderúrgica Nacional (CSN) beschloss, Volta Redonda zum Stahlproduktionsort zu machen. Der durch den Zweiten Weltkrieg erhöhte Stahlbedarf war hierzu die Motivation. Die Stadt wurde in dieser Zeit vornehmlich am Reißbrett entwickelt. Der Ort zählte 1940 nur knapp 3000 Einwohner; 1970 waren es bereits rund 125.000.

Die Gründung erfolgte durch Ausgliederung aus Barra Mansa zum 17. Juli 1954, nach den erforderlichen Wahlen zur Stadtpräfektur und Stadtrat fand die Installation als Munizip am 7. Februar 1955 statt.

Seit der Privatisierung der CSN 1993 verlor die Stahlproduktion aber an Bedeutung und eine Diversifikation setzte ein. Handel und Dienstleistungen spielen heutzutage eine größere Rolle.

Bauwerke
 Estádio General Sylvio Raulino de Oliveira

Geboren in Volta Redonda
 Cláudio Adão (* 1955), Fußballnationalspieler
 Edivaldo (1962–1993), Fußballspieler
 Luíz Antônio dos Santos (1964–2021), Marathonläufer
 Wellington Lope (* 1979), Fußballspieler
 Vanessa Giácomo (* 1983), Schauspielerin
 Felipe Melo (* 1983), Fußballnationalspieler
 Thiago Cunha (* 1985), Fußballspieler
 Thiago Pereira (* 1986), Schwimmer
 Douglas da Silva Vieira (* 1987), Fußballspieler
 Dedé (* 1988), Fußballspieler
 Jeffinho (* 1999), Fußballspieler

Weblinks

 Website der Stadtpräfektur, Prefeitura Municipal (portugiesisch)

Einzelnachweise

Ort in Rio de Janeiro (Bundesstaat)
Município in Rio de Janeiro (Bundesstaat)

Gegründet 1954

redpajama_set_name: RedPajamaWikipedia


Dutch Oven Cobbler Mother's Day. Father's Day Father's Day. Graduation Graduation. Desserts Desserts. Mother's Day Mother's Day. Blackberries Blackberries.
Recipe can be done in a regular oven at 400 degrees but outside cooking makes this a better experience.


text:
Q: operadorAritmetico Bom dia,alguem sabe o que significa essa barra vertical em python?

4|3 =
      7
12|4 =
      12

A: é um operador or binário, ele faz um or com os binários, compara bit a bit fazendo um or e dá o resultado.
4 em binário = 0100
3 em binário = 0011
0100 or 0011 = 0111
7 em binário = 0111
12 em binário = 1100

redpajama_set_name: RedPajamaStackExchange