This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeFamilies #-} | |
-- | |
{-# LANGUAGE DefaultSignatures #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
module Errors where | |
import Control.Lens (makeClassyPrisms, ( # )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Test.Tasty (TestTree, defaultMain, testGroup) | |
import Test.Tasty.Hedgehog (testProperty) | |
import Test.Tasty.HUnit (assertBool, assertFailure, | |
testCaseSteps) | |
import Hedgehog | |
import qualified Hedgehog.Gen as Gen | |
import qualified Hedgehog.Range as Range |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elAttrStylez | |
:: MonadWidget t m | |
=> Text | |
-> m a | |
-> Map Text Text | |
-> m a | |
elAttrStylez e = | |
flip (RD.elAttr e) | |
clayDiv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
** | |
** A template for single-file ATS programs | |
** | |
*) | |
(* ****** ****** *) | |
// | |
#include "share/atspre_define.hats" | |
#include "share/atspre_staload.hats" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newtype AppM a = AppM (Env -> IO a) | |
instance Functor AppM where | |
fmap = error "fmap for AppM not implemented" | |
instance Applicative AppM where | |
pure = error "pure for AppM not implemented" | |
(<*>) = error "ap for AppM not implemented" | |
instance Monad AppM where |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instance (Monad m) => Monad (ReaderT r m) where | |
return = lift . return | |
(>>=) :: ReaderT r m a -> (a -> ReaderT r m b) -> ReaderT r m b | |
(ReaderT rma) >>= k = ReaderT $ \ r -> do | |
a <- rma r | |
let ReaderT rmb = k a -- rmb :: r -> m b | |
rmb r :: m b -- rmb r :: m b | |
ask :: Monad m => (ReaderT r m) r == (r -> m r) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "share/atspre_define.hats" | |
#include "share/atspre_staload.hats" | |
// 1122 produces a sum of 3 (1 + 2) because the first digit (1) matches the second digit and the third digit (2) matches the fourth digit. | |
// 1111 produces 4 because each digit (all 1) matches the next. | |
// 1234 produces 0 because no digit matches the next. | |
// 91212129 produces 9 because the only digit that matches the next one is the last digit, 9. | |
fn fold_stylez { n: int } ( last: int, xs: list(int, n) ): int = | |
let |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Memory Usage & You | |
-- Don't just blame laziness | |
-- Space leaks and how to find them | |
-- Understanding memory usage graphs (*.hp output) | |
-- let / where (accidental sharing is a thing, I don't fully understand it yet) | |
-- Also, saying "Space leaks" doesn't constitute a talking point | |
- Debugging | |
-- How the F... (Starting out) | |
-- DWARF integration (ghci, gdb, lldb) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Sand | |
( Base (..) | |
, Time | |
) | |
where | |
data Base | |
= Sec | |
| Nano | |
| Pico |