(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
{-# LANGUAGE OverloadedStrings #-} | |
module Main (main) where | |
import Control.Concurrent (forkIO) | |
import Control.Concurrent.STM | |
import Control.Monad (when) | |
import Control.Monad.Trans (liftIO) | |
import Network.HTTP.Types | |
import Network.Wai as Wai |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/usr/bin/env runhaskell | |
-- Note: For a slight improvement in performance, import the non-portable | |
-- Data.Array.Unboxed module instead of Data.Array, and change the Board | |
-- type below to use "UArray" instead of "Array". | |
import Data.Array | |
-- Solve the example puzzle specified below | |
-- TODO: read puzzle from input | |
main = do |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
import Control.Monad.IO.Class | |
import Control.Monad.Trans.Class | |
import Prelude hiding (log) | |
-------------------------------------------------------------------------------- | |
-- The API for cloud files. | |
class Monad m => MonadCloud m where | |
saveFile :: Path -> Bytes -> m () |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
{-# LANGUAGE OverloadedLabels #-} | |
{-# LANGUAGE DuplicateRecordFields #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
module LensLabels where | |
import Prelude | |
import Control.Lens | |
import Data.Generics.Labels | |
import GHC.Generics |
{-# LANGUAGE GeneralisedNewtypeDeriving #-} | |
module Data where | |
type UserName = String | |
data DataResult = DataResult String | |
deriving (Eq, Show) | |
class Monad m => Cache m where |