Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE OverloadedStrings, TemplateHaskell, EmptyDataDecls, TypeFamilies #-}
module Main where
import Debug.Trace (trace)
import Happstack.Server
import Web.Routes.Site
import Web.Routes.PathInfo (PathInfo (..), parseSegments)
import Web.Routes.Happstack
{-# LANGUAGE TypeSynonymInstances #-}
module Blaze (
module Text.Blaze.Renderer.String
, module Text.Blaze
) where
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy.UTF8 as LU (toString, fromString)
import Text.Blaze
GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[ 1 of 25] Compiling Feedback.Addresses ( Feedback/Addresses.hs, interpreted )
[ 2 of 25] Compiling Feedback.UID ( Feedback/UID.hs, interpreted )
[ 3 of 25] Compiling Results ( Results.hs, interpreted )
[ 4 of 25] Compiling Build ( Build.hs, interpreted )
[ 5 of 25] Compiling BinReloc.BinReloc ( BinReloc/BinReloc.hs, interpreted )
#include <iostream>
using namespace std;
int countOnes (int n)
{
int r = 0;
while (n > 0) {
if (n % 10 == 1) {
module Enumerator where
import Prelude hiding (init, unwords, words)
import Data.Enumerator hiding (map)
import qualified Data.Enumerator.Text as ET
import qualified Data.Enumerator.List as EL
import Data.Text hiding (reverse, take, map)
import Data.List (sort)
class Documentation m where
doc :: String -> m
-- M1 and M2 are monads.
instance Documentation (M1 ()) where
doc = ...
instance Documentation (M2 ()) where
doc = ...
@fusion5
fusion5 / Test.hs
Last active April 15, 2020 07:30
I want a function (doc) in a type class (Documentable) that works in several monads (M1, M2)
{-# Language TypeSynonymInstances #-}
{-# Language FlexibleInstances #-}
{-# Language FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Main where
import Control.Monad.Except
import Control.Monad.Trans.State
import Data.Sequence as S