Skip to content

Instantly share code, notes, and snippets.

View konn's full-sized avatar
🏠
Working from home

Hiromi Ishii konn

🏠
Working from home
View GitHub Profile
{-# LANGUAGE BangPatterns #-}
import Control.Applicative ((<$>))
main = do
!s <- getContents
putStrLn "Hello, world!"
{-
--another
main = getContents `seq` putStrLn "hoge"
-}
{-# LANGUAGE BangPatterns #-}
import Control.Applicative ((<$>))
import Data.List
main = do
!s <- foldl1' seq <$> getContents
putStrLn "Hello, world!"
{-# LANGUAGE TemplateHaskell #-}
module Macros where
import Language.Haskell.TH
import Control.Monad
extractFields :: Name -> Q [Dec]
extractFields datName = do
(VarI name tp dec fixty) <- reify datName
let mytype = getMotherTypeName tp
(TyConI dec) <- reify mytype
def copy_instance_val(targ)
targ.instance_variables.each{|a| instance_variable_set(a, targ.instance_variable_get(a))}
end
[18 of 86] Compiling Plugin.Dict.DictLookup ( Plugin/Dict/DictLookup.hs, dist/build/Plugin/Dict/DictLookup.o )
Plugin/Dict/DictLookup.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
Plugin/Dict/DictLookup.hs:22:26:
Warning: In the use of `handle'
import Control.Monad.RWS
import Data.Graph.Inductive
import Prelude hiding (map, lookup)
import Data.Map hiding (map)
import Data.Maybe (fromJust)
import Control.Monad
map :: (Functor f) => (a -> b) -> f a -> f b
map = fmap
{-# LANGUAGE NamedFieldPuns #-}
module EasyGrapher (EGGraph(..), EGEdge(..), buildGraph) where
import Data.Graph.Inductive hiding(empty)
import qualified Data.Graph.Inductive as G
import Control.Monad
import Data.Map hiding (map, empty)
import qualified Data.Map as M
import Control.Monad.State
import Data.Maybe
import Prelude hiding (lookup)
{-# LANGUAGE TemplateHaskell, NamedFieldPuns, TupleSections #-}
module Quote (gr) where
import Language.Haskell.TH
import Language.Haskell.TH.Quote
import Text.Parsec hiding ((<|>), many, State)
import Control.Applicative
import EasyGrapher
parseGraph :: (Monad m) => (String, Int, Int) -> String -> m (EGGraph String)
parseGraph (file, line, col) src =
import Prelude hiding ((^^))
import Data.List
tower 1 = (^)
tower n | n > 1 = (\a b -> foldr1 (tower (n-1)) $ genericReplicate b a)
| otherwise = error "n must be positive"
(^^) = tower 2
(^^^) = tower 3
(^^^^) = tower 4
map(Fun, [X|Xs], [X1|Xs1]) :-
!,
Pred =.. [Fun, X, X1],
Pred,
map(Fun, Xs, Xs1).
map(Fun, [], []).
foldl(Fun, X, [Y|Ys], Z) :-
!,
Pred =.. [Fun, X, Y, X1],