code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE MagicHash, UnliftedFFITypes #-} ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2013-15 Edward Kmett -- License : BSD-style (see the file LICENSE) -- Maintainer : Edward Km...
Gabriel439/succinct
src/Succinct/Internal/PopCount.hs
bsd-2-clause
3,365
0
10
520
639
356
283
56
1
{-# OPTIONS_GHC -fno-implicit-prelude #-} ----------------------------------------------------------------------------- -- | -- Module : Numeric -- Copyright : (c) The University of Glasgow 2002 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Sta...
alekar/hugs
packages/base/Numeric.hs
bsd-3-clause
7,397
42
15
1,711
1,241
680
561
36
2
module L07.Anagrams where import Data.Char import Data.List import Data.Function {- Functions you will need -- * fmap :: (a -> b) -> IO a -> IO b * readFile :: FilePath -> IO String * lines :: String -> [String] * permutations :: [a] -> [[a]] * intersectBy :: (a -> a -> Bool) -> [a] -> [a] -> [a] * toLower :: Char ...
juretta/course
src/L07/Anagrams.hs
bsd-3-clause
717
0
8
162
73
42
31
16
1
{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeInType #-} module T17008b where import Data.Kind type family ConstType1 (a :: Type) :: Type where ConstType1 _ = Type type family F1 (x :: ConstType1 a) :: Type where F1 @a (x :: ConstType1 a) = a type family F2 (x :: ConstType1 a) ...
sdiehl/ghc
testsuite/tests/indexed-types/should_compile/T17008b.hs
bsd-3-clause
1,036
28
10
250
484
263
221
-1
-1
{-# LANGUAGE PatternGuards, ViewPatterns, DeriveDataTypeable #-} module General.Template( Template, templateFile, templateStr, templateApply, templateRender ) where import Data.Data import Data.Monoid import General.Str import Data.Generics.Uniplate.Data import Control.Applicative import System.IO.Unsafe impo...
wolftune/hoogle
src/General/Template.hs
bsd-3-clause
3,170
0
16
861
1,142
584
558
73
6
{-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds #-} --{-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} -- Ignore our orphan instance in this file. {-# OPTIONS_GHC -fno-warn-orphans #-} -- Use the supermonad plugin. {-# OP...
jbracker/supermonad-plugin
examples/monad/effect/MainSupermonad3.hs
bsd-3-clause
1,502
1
10
299
580
315
265
34
1
import Control.Concurrent.MVar main = do mv <- forkIO $ do putMVar "one"
the-real-blackh/hexpat
test/dealloc.hs
bsd-3-clause
100
0
11
39
29
14
15
-1
-1
{-# LANGUAGE CPP #-} module Network.Wai.Handler.Warp.SendFile where import Data.ByteString (ByteString) import Network.Sendfile import Network.Socket (Socket) import qualified Network.Wai.Handler.Warp.FdCache as F import Network.Wai.Handler.Warp.Types defaultSendFile :: Socket -> FilePath -> Integer -> Integer -> IO...
sol/wai
warp/Network/Wai/Handler/Warp/SendFile.hs
mit
1,075
0
13
177
332
177
155
11
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-missing-fields #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -------------------...
LinusU/fbthrift
thrift/compiler/test/fixtures/service-fuzzer/gen-hs/TestService_Client.hs
apache-2.0
3,808
0
14
547
860
538
322
56
1
{-| Implementation of Utility functions for storage -} {- Copyright (C) 2013 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyr...
apyrgio/ganeti
src/Ganeti/Storage/Utils.hs
bsd-2-clause
4,069
0
11
647
625
334
291
46
2
{-# LANGUAGE TemplateHaskell #-} module StringsQQ (strings, longstring, typenames) where import Language.Haskell.TH import Language.Haskell.TH.Quote import Data.Char (toUpper) strings = QuasiQuoter { quotePat = undefined, quoteType = undefined, quoteExp = stringsExp, ...
tomjaguarpaw/postgresql-simple
tools/StringsQQ.hs
bsd-3-clause
1,487
0
11
531
388
232
156
30
2
module RenameParamIn5 where merge :: (a -> a -> Ordering) -> [a] -> [a] -> [a] merge cmp xs [] = xs merge cmp [] ys = ys merge cmp (x:xs) (y:ys) = case x `cmp` y of GT -> y : merge cmp (x:xs) ys _ -> x : merge cmp xs (y:ys) {- mergeIt xs ys = merge compare xs ys -} mergeIt xs ys = (case (com...
kmate/HaRe
old/testing/generativeFold/RenameParamIn5.hs
bsd-3-clause
748
0
16
326
308
170
138
15
4
{-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE UnboxedSums #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE TypeFamilies #-} module KindSigs where import Data.Kind -- Kind annotation on type family instance equation type family Foo a where Foo a = Int :: Type -- Kind annotation on component...
sdiehl/ghc
testsuite/tests/parser/should_compile/KindSigs.hs
bsd-3-clause
959
16
9
205
245
145
100
-1
-1
module Lamdu.Data.Expression.Infer.Structure (add) where import Control.Applicative ((<$>), Applicative(..)) import Control.Lens.Operators import Control.Monad (void) import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.State (StateT) import Control.MonadA (MonadA) import qualified Control.Lens as Lens...
aleksj/lamdu
Lamdu/Data/Expression/Infer/Structure.hs
gpl-3.0
1,683
0
14
255
547
307
240
40
1
import Control.Monad (unless,when) import Data.List (isInfixOf) import StackTest main :: IO () main = do stack [defaultResolverArg, "clean"] stack [defaultResolverArg, "init", "--force"] stackCheckStderr ["build", "also-has-exe-foo", "has-exe-foo"] (expectMessage buildMessage1) stackChe...
AndreasPK/stack
test/integration/tests/1198-multiple-exes-with-same-name/Main.hs
bsd-3-clause
1,097
0
9
245
199
107
92
26
1
{- © 2012 Johan Kiviniemi <devel@johan.kiviniemi.name> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCL...
ion1/rcon-haskell
Network/Rcon/Tests/Serialize.hs
isc
3,857
0
12
987
872
451
421
63
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TemplateHaskell #-} module Data.FreeAgent.Types.QuickStart where import qualified Data.ByteString as BS import Control.Applicative ((<$>), (<*>), empty) import Control.Lens import Data.Aeson import ...
perurbis/hfreeagent
src/Data/FreeAgent/Types/QuickStart.hs
mit
1,157
0
15
386
225
131
94
27
0
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE KindSi...
input-output-hk/pos-haskell-prototype
lib/src/Pos/Util/Servant.hs
mit
40,196
0
20
10,352
9,959
5,256
4,703
-1
-1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE RankNTypes #-} module Puzzles where import Data.Holmes import Tower {- Sample puzzles -} config3 :: Config Holmes (Defined (Cell Int)) config3 = definedConfig (Board 3) {- (.) 2 . . . . . . . 1 2 3 3 1 2 2 3 1 -} -- restricted to Defi...
robx/puzzles
towerdefence/src/Puzzles.hs
mit
3,097
0
14
832
1,220
628
592
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} module System.ImportGraph.GetIface where import BinIface import ClassyPrelude import GHC import System.Process import TcRnMonad findIfaces :: Ghc [ModIface] findIfaces = do his <- liftIO findHiFiles _ <- setSessionDynFlags =<< get...
ncaq/haskell-import-graph
lib/System/ImportGraph/GetIface.hs
mit
633
0
10
137
161
83
78
18
1
module Network.IRC.Client.Type ( Net , Bot(..)) where import Control.Monad.Reader import System.IO import Network.TLS import Data.Maybe import System.Log.FastLogger -- | The 'Net' monad, a wrapper over IO, carrying the bot's immutable state. type Net = ReaderT Bot IO data Bot = Bot { socket :: Handle ...
cosmo0920/hs-IRC
Network/IRC/Client/Type.hs
mit
386
0
9
90
89
56
33
12
0
module Eight where cattyConny :: String -> String -> String cattyConny x y = x ++ " mrow " ++ y -- fill in the types -- flip :: (a -> b -> c) -> b -> a -> c flippy :: String -> String -> String flippy = flip cattyConny appedCatty :: String -> String appedCatty = cattyConny "woops" frappe :: String -> String frapp...
mudphone/HaskellBook
src/Eight.hs
mit
1,387
0
12
509
677
341
336
42
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE Rank2Types #-} ...
MaxDaten/yage
src/Yage/Resource/Slot.hs
mit
2,595
0
16
772
784
402
382
49
2
{-# LANGUAGE OverloadedStrings #-} module Nauva.CSS.Helpers where import Data.Text (Text) import qualified Data.Text as T import Control.Monad.Writer.Lazy import Nauva.CSS.Types vh :: Int -> CSSValue vh n = CSSValue $ T.pack $ show n ++ "vh" px :: (Show a) => a -> CSSValue px n = ...
wereHamster/nauva
pkg/hs/nauva-css/src/Nauva/CSS/Helpers.hs
mit
1,406
0
9
280
604
311
293
30
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Web.YahooPortfolioManager.Handlers where import Control.Applicative import Control.Monad.Trans (liftIO) import Data...
lhoghu/intranet
Web/YahooPortfolioManager/Handlers.hs
mit
4,480
0
15
936
1,052
511
541
95
1
module Equinox.ConSat ( C -- :: * -> *; Functor, Monad , Lit(..) -- :: *; Eq, Ord, Show , Con -- :: *; Eq, Ord, Show , Weight -- :: * , wapp , weight , run -- :: C a -> IO a , lift -- :: IO a -> C a , contradiction -- :: C () , newLit -...
msakai/folkung
Haskell/Equinox/ConSat.hs
mit
13,826
0
27
5,328
5,071
2,571
2,500
351
22
{-| Copyright (c) 2014 Maciej Bendkowski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, me...
maciej-bendkowski/LCCLUtils
src/TranslatorTest.hs
mit
3,178
0
17
866
676
362
314
38
2
module Latex where import Data.List import DataTypes import Data.Monoid import TP type Latex = String proof2latex :: BinTree DecoratedSequent -> Latex proof2latex t = aux t where aux (Leaf lab s) = "\\RightLabel{$" ++ lab2latex lab ++ "$}" ++ "\\AxiomC{$" ++ decoratedSeq2latex s ++ "$}" aux (...
gianlucagiorgolo/lambek-monad
Latex.hs
mit
3,168
54
14
782
1,303
638
665
99
3
----------------------------------------------------------------------------- -- | -- Module : Data.EXT2.Info -- Copyright : (C) 2015 Braden Walters, -- 2015 Ricky Elrod -- License : MIT (see LICENSE file) -- Maintainer : Braden Walters <vc@braden-walters.info>, -- Ricky Elro...
meoblast001/ext2-info
src/Data/EXT2/Info.hs
mit
4,820
0
23
1,113
1,095
543
552
98
4
module Graph.Parse ( parse ) where import Control.Monad (guard) import Data.Graph import Text.Parsec (anyToken, notFollowedBy) import qualified Text.Parsec as TP import Text.Parsec.Char (char) import Text.Parsec.Utils (nat) import Text.Re...
samgd/graph
src/Graph/Parse.hs
mit
1,955
0
12
540
442
233
209
39
2
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Unittests for ganeti-htools. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Sof...
damoxc/ganeti
test/hs/Test/Ganeti/Rpc.hs
gpl-2.0
2,786
0
14
445
464
260
204
38
1
{-# LANGUAGE MultiParamTypeClasses #-} {- | Module : ./Propositional/Logic_Propositional.hs Description : Instance of class Logic for propositional logic Copyright : (c) Dominik Luecke, Uni Bremen 2007 License : GPLv2 or higher, see LICENSE.txt Maintainer : luecke@informatik.uni-bremen.de Stability ...
spechub/Hets
Propositional/Logic_Propositional.hs
gpl-2.0
7,242
0
9
1,737
1,050
570
480
137
0
{-# LANGUAGE OverloadedStrings #-} -- | All hardcoded names in the compiler should go in here -- the convention is -- v_foo for values -- tc_foo for type constructors -- dc_foo for data constructors -- s_foo for sort names -- rt_foo for raw names -- class_foo for classes module Name.Names(module Name.Names,module Name...
dec9ue/jhc_copygc
src/Name/Names.hs
gpl-2.0
2,099
0
15
411
521
290
231
40
2
{- ============================================================================ | Copyright 2011 Matthew D. Steele <mdsteele@alum.mit.edu> | | | | This file is part of Fallback. | ...
mdsteele/fallback
src/HSMain.hs
gpl-3.0
1,823
0
7
710
53
32
21
6
1
import Network.Socket import Network.Multicast main = withSocketsDo $ do sock <- multicastReceiver "224.0.0.99" 9999 let loop = do ( msg, _, addr ) <- recvFrom sock 1024 putStrLn ("from: " ++ show addr ++ " text = " ++ msg) sendTo sock "Pong" addr loop in loop
alexginzburg/dprfs
src/multicast-receive.hs
gpl-3.0
273
0
18
59
104
49
55
9
1
module DoubleAuction.Run ( runDoubleAuctionSteps, runDoubleAuctionDebug ) where import FRP.Yampa import DoubleAuction.Model import DoubleAuction.Init import FRP.FrABS import Text.Printf import System.IO rngSeed = 42 t = 1.0 agentCount = 10 dt = 1000 updateStrat = Parallel -- NOTE: would not work correct...
thalerjonathan/phd
coding/libraries/chimera/examples/ABS/DoubleAuction/Run.hs
gpl-3.0
2,025
0
18
615
527
262
265
49
1
(->) a b
hmemcpy/milewski-ctfp-pdf
src/content/1.7/code/haskell/snippet19.hs
gpl-3.0
8
1
7
2
13
5
8
-1
-1
{-# LANGUAGE Arrows #-} module Zombies.Agent ( zombie, human ) where import Zombies.Model import FRP.FrABS import FRP.Yampa import Data.List import Control.Monad.Trans.State import Control.Monad.IfElse import Debug.Trace agentCoordToPatchCoord :: ZombiesEnvironment -> State ZombiesAgentOut Discrete2dCoord...
thalerjonathan/phd
coding/libraries/chimera/examples/ABS/Zombies/Agent.hs
gpl-3.0
4,896
4
15
1,513
1,161
584
577
94
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/RegionInstanceGroupManagers/List.hs
mpl-2.0
7,665
0
19
1,653
753
452
301
112
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/NodeTypes/AggregatedList.hs
mpl-2.0
8,222
0
20
1,763
842
503
339
123
1
x *** y = x
lspitzner/brittany
data/Test75.hs
agpl-3.0
12
0
5
5
12
5
7
1
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} -- | -- How to run Databrary Actions. -- -- This module is the foundation of the site. It provides a method for packaging -- up route actions into 'Wai.Application's (which is effectively the HTTP -- transport layer), as well as a method for packaging them...
databrary/databrary
src/Action/Run.hs
agpl-3.0
7,726
0
18
1,883
1,061
603
458
-1
-1
-- This is a simple hello world propgram, which renders "hello world" as text import GEGL import qualified System.Environment as E main :: IO () main = do args <- E.getArgs str <- if null args then return "woo!" else return $ unwords args gegl_init putStrLn str gegl <- gegl_node_new pu...
nek0/gegl
examples/example00.hs
lgpl-3.0
1,036
0
14
216
271
120
151
30
2
import System.Exit (exitFailure) import Data.Algorithm.Diff.Gestalt import Data.Algorithm.Diff (Diff(..)) main :: IO () main = if diff "diff" "riffs" == [First "d", Second "r", Both "iff" "iff", Second "s"] then return () else exitFailure
chrismwendt/diff-gestalt
test/Spec.hs
unlicense
244
0
8
38
96
53
43
7
2
-- Page 97 #1 import Data.Char (digitToInt) asInt :: String -> Int asInt [] = error "Cannot convert the empty string" asInt '-' = error "Cannot convert a single empty string" asInt ('-':str) = -1 * (asInt str) asInt str = foldl (\memo it -> memo * 10 + it) 0 (map (digitToInt) str)
RobertFischer/real-world-haskell
ch04/AsInt.hs
unlicense
284
0
9
56
116
60
56
6
1
import Data.Monoid -- isBigGang is used to explain Writer monad isBigGang :: Int -> (Bool, String) isBigGang x = (x > 9, "Compared gang size to 9.") -- if we want to feed the (Bool, String) value to isBigGang, we have to do extra work -- here we create a function called "applyLog", just similar to "applyMaybe" create...
Oscarzhao/haskell
learnyouahaskell/monads/applyXxx.hs
apache-2.0
691
0
10
135
220
126
94
11
1
{-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | -- Metadata for SAML V2.0 -- -- <http://docs.oasis-open.org/security/saml/v...
dylex/hsaml2
SAML2/Metadata/Metadata.hs
apache-2.0
17,930
0
25
3,352
4,145
2,250
1,895
393
1
-- | Allow the defines file to indicate dings that will zero out a section. module Grade.Score.Zeroing (zeroing) where import qualified Text.Trifecta as T import Grade.Types (ExSecCallback(..), SecCallback(..)) data Zeroing a = Zeroed | Earned a deriving (Show) instance Monoid a => Monoid (Zeroing...
nwf/grade
lib/Grade/Score/Zeroing.hs
bsd-2-clause
1,713
0
12
599
560
291
269
37
2
{-# LANGUAGE NoImplicitPrelude #-} module Stack.Options.ConfigParser where import Data.Char import Options.Applicative import Options.Applicative.Builder.Extra import Path import Stack.Constants import Stack.Options.BuildMonoidParser import Stack.Op...
juhp/stack
src/Stack/Options/ConfigParser.hs
bsd-3-clause
7,563
0
41
2,513
1,177
609
568
157
3
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, TypeFamilies, EmptyDataDecls #-} -- | Concurrency for Haste. Includes MVars, forking, Ajax and more. module Haste.Concurrent ( module Haste.Concurrent.Monad, module Ajax, Recv, Send, Inbox, Outbox, MBox, receive, spawn, statefully, (!), (<!...
joelburget/haste-compiler
libraries/haste-lib/src/Haste/Concurrent.hs
bsd-3-clause
2,957
0
13
668
641
334
307
-1
-1
module Main where import Idris.AbsSyntax import Idris.Core.TT import Idris.ElabDecls import Idris.Main import Idris.ModeCommon import Idris.REPL import IRTS.CodegenOCaml import IRTS.Compiler import System.Environment import System.Exit import Paths_idris_ocaml data Opts = Opts { inputs :: [FilePath], ...
ziman/idris-ocaml
src/Main.hs
bsd-3-clause
1,202
0
12
335
399
206
193
34
4
module Main where import Nouns import Data.ByteString.Lazy.Char8 (pack) import Data.Char import Data.Maybe import Data.Text (unpack) import Network.HTTP.Types (status200, status404) import Network.Wai import Network.Wai.Handler.Warp (run) import Network.Wai.Middleware.Gzip (gzip, def) import System.Environment import...
nicolasbrugneaux/hack-berry
src/Main.hs
bsd-3-clause
1,848
0
14
354
702
360
342
51
2
{-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS -fno-warn-type-defaults #-} -- | Try Haskell! module TryHaskell where import Control.Arrow ((***)) import ...
chrisdone/tryhaskell
src/TryHaskell.hs
bsd-3-clause
15,385
0
22
5,126
4,070
2,048
2,022
-1
-1
module HVG.SVGState where import Text.Printf import Data.List import Control.Monad import Debug.Trace import HVG.Type import HVG.Geometry data SVGState = SVGState { svgTrans :: Trans , svgCursor :: Pos } initSVGState :: SVGState initSVGState = SVGState identityTrans (Pos 0 0) setTr :: Trans -> Builder info S...
CindyLinz/Haskell-HVG
src/HVG/SVGState.hs
bsd-3-clause
12,302
0
21
2,488
2,657
1,379
1,278
-1
-1
{-# LANGUAGE PatternGuards #-} module Idris.DSL where import Data.Generics.Uniplate.Data (transform) import Idris.AbsSyntax import Idris.Core.TT import Idris.Core.Evaluate import Control.Monad.State.Strict import Debug.Trace debindApp :: SyntaxInfo -> PTerm -> PTerm debindApp syn t = debind (dsl_bind (dsl_info sy...
BartAdv/Idris-dev
src/Idris/DSL.hs
bsd-3-clause
9,471
0
17
3,478
4,490
2,196
2,294
187
21
module Utils.THExpander.Types where data Env = Env {_envType :: EnvType, _ignoredFiles :: [FilePath], --relative to dirToExpand paths of ignored files _ignoredDirs :: [FilePath], --relative to dirToExpand paths of ignored dirs _dirsNotToCopy :: [FilePath], --relative to dirToExpand paths of dirs that sh...
AnkalagonBlack/th-expander
src/Utils/THExpander/Types.hs
bsd-3-clause
567
12
10
121
135
85
50
10
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Compiler -- Copyright : Isaac Jones 2003-2004 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability : por...
typelead/epm
Cabal/Distribution/Compiler.hs
bsd-3-clause
7,280
0
15
1,395
1,291
726
565
102
2
module Angel.LogSpec (spec) where import Angel.Log import Data.Time import Data.Time.Calendar (fromGregorian) import Data.Time.LocalTime (timeOfDayToTime, TimeOfDay(..), TimeZone(..), ZonedTime(..)) import SpecHelper spec :: Spec s...
zalora/Angel
test/Angel/LogSpec.hs
bsd-3-clause
760
0
12
234
170
96
74
18
1
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} module Handler.Project where import Import import qualified Data.Text as T import System.Directory import Text.Blaze.Internal (preEscapedText) getNewProjectR :: Handler Html getNewProjectR = do u <- requireAuth now <- liftIO getCurrentTime let inintstatuses = "!...
cutsea110/BISocie
Handler/Project.hs
bsd-3-clause
3,880
0
24
1,352
991
494
497
-1
-1
{-# LANGUAGE FlexibleContexts #-} module Karamaan.Opaleye.Table where import Karamaan.Opaleye.QueryArr (Query, next, tagWith, simpleQueryArr) import Database.HaskellDB.PrimQuery (PrimQuery(Project, BaseTable), PrimExpr(AttrExpr), Attribute, Ass...
dbp/karamaan-opaleye
Karamaan/Opaleye/Table.hs
bsd-3-clause
3,111
0
11
696
745
407
338
-1
-1
module Gittins.Pretty ( prettyLog , summary ) where import Prelude hiding ((<$>)) import Gittins.Config import Gittins.Process import Gittins.Types import Text.PrettyPrint.ANSI.Leijen hiding (list) summary :: String -> String -> String -> Doc summary header body err = cyan (text header) <> (if null err...
bmjames/gittins
src/Gittins/Pretty.hs
bsd-3-clause
1,995
0
20
506
676
338
338
-1
-1
module SpecHelper where import Data.Foldable import Data.IORef import qualified Data.Sequence as S import qualified Data.Text as T import Snap import Snap.Snaplet.Heist import Snap.Snaplet.Session.Backends.CookieSession import qualified Snap.Test as ST import Test.Hspec import Wikirick.Application import qualified Wi...
keitax/wikirick
spec/SpecHelper.hs
bsd-3-clause
2,266
0
14
376
629
342
287
57
1
-- File: Optimal4.hs -- Author: Adam Juraszek -- Purpose: Partly generated map of optimal second guesses for 4 cards answers. -- Source: https://github.com/juriad/Cardguess module Optimal4 where import Common import Data.Map as Map optimal4 :: Map.Map Feedback Selection optimal4 = Map.fromList [ ( ( 0 , 0 , 0 ...
hikui/Cardguess
src/Optimal4.hs
mit
30,846
0
9
10,956
16,112
9,209
6,903
579
1
{-# LANGUAGE TemplateHaskell #-} module NFA.Nerode.Congruent.Instance where import Autolib.Reader import Autolib.ToDoc import Convert.Language import Autolib.Exp import Autolib.NFA ( NFAC ) import Data.Typeable data NFAC c Int => Instance c = Instance { language :: Language c , goal :: [c] ...
florianpilz/autotool
src/NFA/Nerode/Congruent/Instance.hs
gpl-2.0
696
0
9
205
168
102
66
-1
-1
import Drawing import Exercises import Geometry main = drawPicture myPicture myPicture points = message "Right triangle ABC" {- & faint ( drawPointLabel b' "B'" & drawSegment (b,b') ) -} & drawPointsLabels [a,b,c] ["A","B","C"] & drawSegment (a,b) & drawSegment (b,c) ...
alphalambda/hsmath
src/Learn/Geometry/ex16righttriangle.hs
gpl-2.0
412
0
10
122
134
74
60
12
1
-- Bug: reported by Jan Scheffczyk, November 2004. verzahne :: ( [a] -> [a] -> Bool) -> [a] -> [a] -> [a] verzahne _ xs [] = xs verzahne _ [] ys = ys verzahne le (x:xs) (y:ys) | x `le` y = x : (verzahne le xs (y:ys)) |otherwise = y : (verzahne le (x:xs) ys)
roberth/uu-helium
test/typeerrors/Examples/Verzahne.hs
gpl-3.0
269
0
10
68
162
86
76
6
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-s3/gen/Network/AWS/S3/HeadBucket.hs
mpl-2.0
2,658
0
9
548
340
208
132
48
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/CancelArchival.hs
mpl-2.0
3,908
0
9
866
523
317
206
63
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} module Tyckiting.AI where import Prelude () import Prelude.Compat import Control.Arrow.Transformer.Automaton import Control.Monad.Random (RandT, runRandT) import Control.Monad.RWS (MonadReader (..), MonadWriter (..), RWS, runRWS) import ...
vvmann/tyckiting-bot
clients/haskell/src/Tyckiting/AI.hs
mit
4,634
0
24
1,041
1,287
728
559
90
1
{-# OPTIONS -fno-warn-tabs #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and -- detab the module (please do the detabbing in a separate patch). See -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces -- fo...
nomeata/ghc
compiler/vectorise/Vectorise/Monad/Local.hs
bsd-3-clause
2,786
42
13
553
695
371
324
58
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Desugaring exporessions. -} {-# LANGUAGE CPP #-} module DsExpr ( dsExpr, dsLExpr, dsLocalBinds, dsValBinds, dsLit ) where #include "HsVersions.h" import Match import MatchLit import DsBinds import DsGRHSs import DsList...
DavidAlphaFox/ghc
compiler/deSugar/DsExpr.hs
bsd-3-clause
38,233
48
25
11,456
7,920
4,040
3,880
-1
-1
{-# Language FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# Language TypeSynonymInstances #-} module Pretty ( ppdecl, ppexpr, ppsignature, pptype ) where import Type import Syntax import Infer import Text.PrettyPrint parensIf :: Bool -> Doc -> Doc parensIf True = parens parensIf False = id c...
yupferris/write-you-a-haskell
chapter9/provenance/Pretty.hs
mit
1,985
0
12
564
826
424
402
69
1
module IOPutStrLnUsed where import System.IO (putStrLn) main :: IO () main = putStrLn "test"
serokell/importify
test/test-data/base@basic/04-IOPutStrLnUsed.hs
mit
95
0
6
16
32
18
14
4
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE NoMonomorphismRestriction #-} module T15783B(f) where d = 0 f = [|| d ||]
sdiehl/ghc
testsuite/tests/th/T15783B.hs
bsd-3-clause
122
1
5
21
28
20
8
-1
-1
{-# LANGUAGE BangPatterns #-} -- This is a non-exposed internal module -- -- The code in this module has been ripped from containers-0.5.5.1:Data.Map.Base [1] almost -- verbatimely to avoid a dependency of 'template-haskell' on the containers package. -- -- [1] see https://hackage.haskell.org/package/containers-0.5.5....
sdiehl/ghc
libraries/template-haskell/Language/Haskell/TH/Lib/Map.hs
bsd-3-clause
3,991
0
21
1,413
2,024
1,016
1,008
85
8
module Fixme where {-@ instancesB :: Int -> Int @-} instancesB :: Int -> Int instancesB x = x
mightymoose/liquidhaskell
tests/parser/pos/TokensAsPrefixes.hs
bsd-3-clause
94
0
5
19
22
13
9
3
1
/* { dg-options "-I. -I $srcdir/gcc.dg/pch -Wno-deprecated" } */ #import "import-1a.h" #include "import-1b.h" #include "import-1c.h" #define IMPORT_1
SanDisk-Open-Source/SSD_Dashboard
uefi/gcc/gcc-4.6.3/gcc/testsuite/gcc.dg/pch/import-1.hs
gpl-2.0
150
4
6
17
23
14
9
1
0
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} module TCPOptions where import GHC.Generics import Data.Serialize import Data.Word import Data.List (intercalate) import Text.Printf import Control.Applicative import Data.ByteString.Char8 (ByteString, pack, unpack) data TCPOptions = TCPOptions ...
mjansen/tcp-analyse
TCPOptions.hs
mit
4,542
0
16
1,142
1,322
673
649
107
2
module SpaceState.Common where import Data.List import Control.Monad.State as State import Prelude hiding (catch) import Entity import Camera import SpaceState.Game releaseKeys :: StateT SpaceState IO () releaseKeys = do setTurn 0 accelerate 0 -- prevent involuntary actions setZoomDelta 0 recoveryText :: Stri...
anttisalonen/starrover2
src/SpaceState/Common.hs
mit
1,134
0
9
225
245
133
112
27
1
module Render ( renderDoc ) where import qualified Graphics.Svg as SVG import qualified Graphics.Svg.CssTypes as CSS import qualified Linear import Types import Transformation import SvgArcSegment import Approx import SVGExt import qualified CircularArc as CA import qualified BiArc as BA import qualifi...
domoszlai/juicy-gcode
src/Render.hs
mit
12,279
0
21
3,913
4,563
2,374
2,189
183
36
-- | Text manipulation utilities. module Util.Text where import Prelude import qualified Data.Text as T -- | Joins a list of texts with the given text separating them. joinWith :: T.Text -> [T.Text] -> T.Text joinWith sep = T.concat . map (`T.append` sep) -- | Similar to joinWith, but doesn't add the separator at th...
MultiMC/Old-QuickMod.io
Util/Text.hs
mit
445
0
10
79
131
75
56
7
1
module Chapter5 where import Data.Char (ord, chr) import Data.Ix (inRange) factors n = [x | x <- [1 .. n], n `mod` x == 0] isPerfect n = n == sum (init (factors n)) -- Caesar code caesar :: Int -> String -> String caesar k = map f where f c | inRange ('a','z') c = tr 'a' k c | inRange ('A','Z') c ...
ricca509/haskellFP101x
src/book/chapter5.hs
mit
548
0
11
147
281
146
135
15
1
module Writer where import Control.Monad data Writer s a = MkWriter [s] a instance Functor (Writer s) where fmap f (MkWriter ss x) = MkWriter ss (f x) instance Applicative (Writer s) where pure x = MkWriter [] x MkWriter ss f <*> MkWriter ss' x = MkWriter (ss ++ ss') (f x) instance Monad (W...
NickAger/LearningHaskell
Monads and all that/Readers and Writers.hsproj/Writer.hs
mit
467
0
11
122
238
118
120
13
1
-- Problems/Problem037Spec.hs module Problems.Problem037Spec (main, spec) where import Test.Hspec import Problems.Problem037 main :: IO() main = hspec spec spec :: Spec spec = describe "Problem 37" $ it "Should evaluate to 748317" $ p37 `shouldBe` 748317
Sgoettschkes/learning
haskell/ProjectEuler/tests/Problems/Problem037Spec.hs
mit
270
0
8
51
73
41
32
9
1
import System.IO import Data.Char import Data.List import Data.Maybe --Define types for an easier reading type Line = [Int] type Column = [Int] type Vector = [Square] type Square = [Line] type Sudoku = [Vector] main = do let list = [] handle <- openFile "sudoku.txt" ReadMode contents <- hGetCo...
fthomasmorel/Sudoku-solver
Sudoku.hs
mit
8,332
0
19
1,931
3,088
1,660
1,428
103
9
{-# LANGUAGE CPP #-} module GHCJS.DOM.WebKitNamespace ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.WebKitNamespace #else #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) import GHCJS.DOM.JSFFI.G...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/WebKitNamespace.hs
mit
358
0
5
33
33
26
7
4
0
-- hooray for Haskell! Some basic functions and executions. Based off of Learn You a Haskell for Great Good -- compile with ghc -o intro intro.hs, then execute with ./intro -- the parens are needed because Haskell will attempt to pass doubleUs to print. Order of operations is FPEMDAS. Say that aloud and giggle. --...
heidtn/Haskell_Tutorials
intro.hs
mit
700
0
11
148
74
38
36
5
1
module Exercise where import Data.List type Node = Int type Graph = [(Node, [Node])] bereikbaar :: Node -> Graph -> [Node] bereikbaar n g = bereikbaar' n g [] bereikbaar' :: Node -> Graph -> [Node] -> [Node] bereikbaar' n g vns = concat [y : (bereikbaar' y g (y:vns)) | y <- (adjacentNodes n g) \\ vns] adjacentNode...
tcoenraad/functioneel-programmeren
2012/opg3d.hs
mit
808
0
12
200
402
215
187
21
1
module Test.Scher ( module Test.Scher.Property ) where import Test.Scher.Property
m-alvarez/scher
Test/Scher.hs
mit
89
0
5
16
21
14
7
3
0
{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts #-} module Code.Nocode where import Code.Formal import Challenger.Partial import Inter.Types import Inter.Quiz import Autolib.Reporter import Autolib.FiniteMap import Autolib.ToDoc import Autolib.Reader import Autolib.Util.Z...
Erdwolf/autotool-bonn
src/Code/Nocode.hs
gpl-2.0
2,590
9
18
704
970
510
460
71
2
{- This module was generated from data in the Kate syntax highlighting file mips.xml, version 1.03, by Dominik Haumann (dhdev@gmx.de) -} module Text.Highlighting.Kate.Syntax.Mips (highlight, parseExpression, syntaxName, syntaxExtensions) where import Text.Highlighting.Kate.Types import Text.Highlighting.K...
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Mips.hs
gpl-2.0
6,160
0
25
1,091
1,277
678
599
96
5
{-# OPTIONS -fglasgow-exts -fno-monomorphism-restriction #-} ---------------------------------------------------------------------------- -- | -- Module : Text.XML.Schema.Org.W3.N2001.XMLSchema_instance -- Copyright : (c) Simon Foster 2004 -- License : GPL version 2 (see COPYING) -- -- Maintainer : aca...
twopoint718/haifa
src/Text/XML/Schema/Org/W3/N2001/XMLSchema_instance.hs
gpl-2.0
2,411
1
14
558
321
190
131
25
1
module Common where -- |Integer multiply. Multiplies integer by a factor given in a -- rational number. iMult :: (Integral a) => Rational -> a -> a iMult a b = round $ toRational b * a
zouppen/valo
new/Common.hs
gpl-3.0
185
0
7
37
49
27
22
3
1
{- This file is part of PhoneDirectory. Copyright (C) 2009 Michael Steele PhoneDirectory is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any lat...
mikesteele81/Phone-Directory
src/TestUnitConversion.hs
gpl-3.0
1,392
2
10
267
184
94
90
17
1
module DepProcessors.Npm ( findDefinitions, installFromDefinition, extractFilePath, NpmDefinition ) where import qualified DepProcessors.Data.Result as R import DepProcessors.ProcessorHelpers (getFileName, executeGenericProcessor, GenericProcessorConfig(..)) findDefinitions :: [FilePath] -> IO [NpmDefinit...
splondike/depcache
src/DepProcessors/Npm.hs
gpl-3.0
944
0
10
157
205
118
87
19
1
module Utils where inspect :: Show a => IO a -> IO () inspect = (=<<) print
ptitfred/slidecoding
demo/src/Utils.hs
gpl-3.0
77
0
8
18
38
20
18
3
1
-- grid is a game written in Haskell -- Copyright (C) 2018 karamellpelle@hotmail.com -- -- This file is part of grid. -- -- grid is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the Lice...
karamellpelle/grid
source/Game/Run/Output/Plain/Screen.hs
gpl-3.0
11,274
0
14
2,982
2,495
1,246
1,249
199
4
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE PatternSynonyms #-} -- | Data structures to keep track of some properties of the Ast structure. module Sara.Z3.AstWrapper ( ProofObligation , Assumption ...
Lykos/Sara
src/lib/Sara/Z3/AstWrapper.hs
gpl-3.0
4,034
3
14
1,008
1,119
576
543
90
5
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dlp/gen/Network/Google/Resource/DLP/Projects/DlpJobs/Get.hs
mpl-2.0
4,865
0
15
1,075
701
412
289
102
1
{-# LANGUAGE OverloadedStrings #-} module Network.Haskoin.Crypto.Mnemonic.Units (tests) where import Data.ByteString (ByteString) import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as C import Data.Either (fromRigh...
plaprade/haskoin
haskoin-core/test/Network/Haskoin/Crypto/Mnemonic/Units.hs
unlicense
14,018
0
16
2,832
1,023
590
433
163
2