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 RecursiveDo, RankNTypes, NamedFieldPuns, RecordWildCards #-} module Distribution.Server.Features.Upload ( UploadFeature(..), UploadResource(..), initUploadFeature, UploadResult(..), ) where import Distribution.Server.Framework import Distribution.Server.Framework.BackupDump import Distr...
ocharles/hackage-server
Distribution/Server/Features/Upload.hs
bsd-3-clause
19,842
0
30
5,264
3,101
1,697
1,404
282
8
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="hi-IN"> <title>Passive Scan Rules - Beta | ZAP Extension</title> <maps> <homeID>top</homeID>...
thc202/zap-extensions
addOns/pscanrulesBeta/src/main/javahelp/org/zaproxy/zap/extension/pscanrulesBeta/resources/help_hi_IN/helpset_hi_IN.hs
apache-2.0
986
78
67
162
420
212
208
-1
-1
{- (c) The University of Glasgow 2006 (c) The GRASP Project, Glasgow University, 1992-2000 Defines basic functions for printing error messages. It's hard to put these functions anywhere else without causing some unnecessary loops in the module dependency graph. -} {-# LANGUAGE CPP, DeriveDataTypeable, ScopedTypeVari...
ml9951/ghc
compiler/utils/Panic.hs
bsd-3-clause
9,492
0
18
2,593
1,798
927
871
155
10
{-# OPTIONS -fglasgow-exts #-} -- Tests the "stupid theta" in pattern-matching -- when there's an existential as well module ShouldCompile where data (Show a) => Obs a = forall b. LiftObs a b f :: Show a => Obs a -> String f (LiftObs _ _) = "yes"
hvr/jhc
regress/tests/1_typecheck/2_pass/ghc/tc182.hs
mit
271
0
7
72
68
38
30
-1
-1
module LayoutLet2 where -- Simple let expression, rename xxx to something longer or shorter -- and the let/in layout should adjust accordingly -- In this case the tokens for xxx + a + b should also shift out foo xxx = let a = 1 b = 2 in xxx + a + b
mpickering/ghc-exactprint
tests/examples/transform/LayoutLet2.hs
bsd-3-clause
266
0
8
71
39
22
17
3
1
-- In this example, adding 'main' to the export will fail as it is already exported. module A1 where import D1 import C1 import B1 main :: Tree Int ->Bool main t = isSame (sumSquares (fringe t)) (sumSquares (B1.myFringe t)+sumSquares (C1.myFringe t))
SAdams601/HaRe
old/testing/fromConcreteToAbstract/A1_TokOut.hs
bsd-3-clause
285
0
11
74
80
42
38
7
1
{-# LANGUAGE MagicHash #-} module Foo where foo# = 'a'
urbanslug/ghc
testsuite/tests/parser/should_compile/read047.hs
bsd-3-clause
59
0
4
14
10
7
3
3
1
module Annfail01 where -- Testing annotating things that don't exist {-# ANN type Foo (1 :: Int) #-} {-# ANN f (1 :: Int) #-}
urbanslug/ghc
testsuite/tests/annotations/should_fail/annfail01.hs
bsd-3-clause
126
0
2
25
7
6
1
3
0
module Chapter8.Syntax.Number where import Data.Monoid import Data.Display import Chapter8.Syntax.Type data NumVal = NumZero | NumSucc NumVal deriving (Eq, Show) toRealNum :: NumVal -> Integer toRealNum = walk 0 where walk c nv = case nv of NumZero -> c NumSucc v -> walk (c + 1) v instance Ord ...
VoQn/tapl-hs
src/Chapter8/Syntax/Number.hs
mit
1,016
0
13
284
372
193
179
35
2
{-# LANGUAGE DeriveDataTypeable #-} module CodeAdapter where import Control.Monad.IfElse import SoOSiM import Code import Node data TransfomerState = TransfomerState data CodeAdapterMsg = Compile BlockCode Architecture deriving (Typeable) instance ComponentIface TransfomerState where initState = Transf...
christiaanb/SoOSiM
examples/Twente/CodeAdapter.hs
mit
597
0
12
101
132
70
62
17
0
{-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- -- Module : DataAssociation.Explore.UI.Web.Server -- Copyright : -- License : MIT -- -- Maintainer : - -- Stability : -- Portability : -- -- | -- ---------------------------------------...
fehu/min-dat--a-priori
explore-web-backend/src/DataAssociation/Explore/UI/Web/Server.hs
mit
1,484
0
17
268
330
184
146
24
1
{-# LANGUAGE TypeOperators, OverloadedStrings #-} module Cypher.Actions where import Cypher.Types import Cypher.Utils import Data.Monoid import Control.Monad.Free import Data.Text as T commitTransaction :: Neo4jRequest ~> TransactionResponse commitTransactio...
5outh/cypher
src/Cypher/Actions.hs
mit
2,943
0
13
454
803
408
395
53
1
import Utils import qualified Data.Set as S import Control.Monad.State import Debug.Trace import Data.List (foldl') nmax = 1000000 sumSquareDigit :: Int -> Int --sumSquareDigit n = sum $ map (^2) $ numberToDigitsBackwards n sumSquareDigit n | n<10 = n^2 | otherwise = (n `mod` 10)^2 + sumSquareDigit (...
arekfu/project_euler
p0092/p0092.hs
mit
1,704
0
13
487
467
259
208
26
3
module Import ( module Import ) where import Prelude as Import hiding (head, init, last, readFile, tail, writeFile) import Yesod as Import hiding (Route (..)) import Yesod.Static as Import import ...
collaborare/antikythera
src/Import.hs
mit
1,088
0
6
529
129
95
34
17
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SVGAnimatedEnumeration (js_setBaseVal, setBaseVal, js_getBaseVal, getBaseVal, js_getAnimVal, getAnimVal, SVGAnimatedEnumeration, castToSVGAnimatedEnumeration, gTypeSVGAnimatedEnumeration) ...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SVGAnimatedEnumeration.hs
mit
2,196
20
8
255
508
308
200
31
1
module Clavier.SortingAlgorithms (selection_sort, insertion_sort, merge_sort, quick_sort) where import Data.List selection_sort :: (Ord a) => [a] -> [a] selection_sort (x : []) = [x] selection_sort [] = [] selection_sort li = let select_min min [] prev = (min, prev) select_min min (x:xs) prev | x < min = sel...
Raekye/The-Modern-Clavier
haskell/src/Clavier/SortingAlgorithms.hs
mit
1,877
28
15
386
1,039
546
493
61
3
module HaskellRead where import File import System.FilePath.Posix (takeExtension) import Text.Regex.Posix import Util isSupportedFilePath :: FilePath -> Bool isSupportedFilePath = (==) ".hs" . takeExtension isSupportedFile :: File -> Bool isSupportedFile file = (extension ...
larioj/nemo
src/HaskellRead.hs
mit
1,076
0
8
225
266
149
117
27
1
-- | Exercises for Chapter 6. -- -- Implement the functions in this module using recursion. module Chapter06 (and, concat, replicate, elem, (!!), merge, msort) where import Prelude hiding (and, concat, elem, replicate, (!!)) -- * Exercise 1 -- | Decide if all logical values in a list are true. and :: [Boo...
EindhovenHaskellMeetup/meetup
courses/programming-in-haskell/pih-exercises/src/Chapter06.hs
mit
1,126
0
8
248
248
154
94
16
1
module DecryptEnvironment () where import Text.Read(readMaybe) import Global(Error, Arg, Rounds, KeyFilename) type DecryptEnv = () -- TODO
tombusby/haskell-des
round/DecryptEnvironment.hs
mit
142
0
5
20
43
28
15
4
0
-- There might be a clever way to work out the digits on paper -- by counting the number sizes, but this is faster. import Data.Char (ord) digitToInt d = (ord d) - (ord '0') frac = concat $ map show [0..] digits = map (\i -> digitToInt $ frac !! (10^i)) [0..6] answer = product digits main = print answer
gumgl/project-euler
40/40.hs
mit
310
0
10
66
108
58
50
6
1
module Data.Set.Data where import qualified Data.Set as Set setTo :: Int -> Set.Set Int setTo n = Set.fromList [1..n] set1 :: Set.Set Int set1 = setTo 10 set2 :: Set.Set Int set2 = setTo 20 set3 :: Set.Set Int set3 = setTo 30 set4 :: Set.Set Int set4 = setTo 40 set5 :: Set.Set Int set5 = setTo 50
athanclark/sets
bench/Data/Set/Data.hs
mit
307
0
7
68
137
72
65
14
1
{-# LANGUAGE BangPatterns #-} module Main where import System.Random (randomRIO) import Control.Monad (replicateM) import Debug.Trace -- | Perceptron implementation in Haskell (dirty) -- type Input = [Double] type Data = [(Input, Double)] type Weights = [Double] type Rate = Double -- [0,1] round'...
cirquit/Personal-Repository
Haskell/machine-learning/perceptron/perceptron.hs
mit
3,511
0
16
1,224
1,782
1,084
698
89
2
{-# LANGUAGE OverloadedStrings #-} module Main where import Parse import System.Environment main = do f <- readFile "prog.txt" args <- getArgs let command = if length args > 0 then prog else finish prog case runParser command f of xs -> do mapM_ print $ take 5 xs print $ length xs
kovach/cards
src/Main.hs
mit
310
0
13
80
105
50
55
12
2
{-# Language TemplateHaskell #-} module Main where -- base import Data.Monoid import Control.Applicative -- linear import Linear -- lens import Control.Lens -- gloss import Graphics.Gloss import Graphics.Gloss.Interface.Pure.Game -- colour import Data.Colour (Colour) import Data.Colour.RGBSpace import Data.Colour.RGBSp...
startling/falling
main.hs
mit
3,241
0
19
791
848
460
388
-1
-1
-- ------------------------------------------------------------------------------------- -- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved. -- For email, run on linux (perl v5.8.5): -- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0...
cbrghostrider/Hacking
HackerRank/FunctionalProgramming/Recursion/sierpinskiTriangleFractals.hs
mit
3,648
3
22
968
1,495
849
646
57
3
module TestInternal ( runTests , leftistHeapProperty ) where import Data.Char import HeapInternal as Heap import qualified Data.List as List import TestHeapCommon import TestQuickCheck runTests :: IO () runTests = do qc "Eq" (eqProperty :: HeapT Int Char -> HeapT Int Char -> HeapT Int Char -> Bool) ...
PepeLui17/Proyecto_Lenguajes_De_Programacion_Segundo_Parcial
TestInternal.hs
gpl-2.0
4,828
0
22
1,262
2,077
1,052
1,025
104
2
{- | Module : $Header$ Description : A parser for the SPASS Input Syntax Copyright : (c) C. Immanuel Normann, Heng Jiang, C.Maeder, Uni Bremen 2007 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : portable A parser for the SPAS...
nevrenato/Hets_Fork
SoftFOL/DFGParser.hs
gpl-2.0
13,931
0
26
4,057
4,221
2,105
2,116
393
7
-- Largest prime factor of 600,851,475,143 -- Test to see if n is divisible evenly by a number in [2..n] -- if yes then return that number and factorise on n`div`x primeFacts n [] = n:[] primeFacts n (x:xs) | n `mod` x == 0 = x:primeFacts (n`div`x) [2..(n`div`x) -1] | otherwise = primeFacts n xs main = do retur...
NaevaTheCat/Project-Euler-Haskell
P3.hs
gpl-2.0
378
1
11
74
133
71
62
6
1
ana :: Functor f => (a -> f a) -> a -> Fix f ana coalg = Fix . fmap (ana coalg) . coalg
hmemcpy/milewski-ctfp-pdf
src/content/3.8/code/haskell/snippet25.hs
gpl-3.0
87
0
9
23
59
28
31
2
1
module Language.SMTLib2.Internals.Type.Struct where import Language.SMTLib2.Internals.Type.Nat import Language.SMTLib2.Internals.Type.List (List(..)) import qualified Language.SMTLib2.Internals.Type.List as List import Prelude hiding (mapM,insert) import Data.GADT.Compare import Data.GADT.Show import Data.Functor.Ide...
hguenther/smtlib2
Language/SMTLib2/Internals/Type/Struct.hs
gpl-3.0
6,285
0
16
1,746
3,281
1,640
1,641
-1
-1
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable, RecordWildCards #-} -- |Encoder for any kind of streaming content with some kind of -- separators. module Main where import qualified Data.ByteString.Char8 as BS import Network import System.Console.CmdArgs.Implicit import System.IO data Args = Args { socket :: Stri...
koodilehto/kryptoradio
data_sources/streaming/Main.hs
agpl-3.0
1,692
0
16
440
427
210
217
42
3
module Main where import Tokenizer import Types import Grammar import FP_ParserGen -- Touching this file leaves you at your own devices import ASTBuilder import Checker import CodeGen -- import Simulation import System.FilePath import Sprockell main :: IO() main = do putStrLn "What file do you want to run...
wouwouwou/2017_module_8
src/haskell/PP-project-2017/Main.hs
apache-2.0
897
0
16
239
196
99
97
27
1
{-# language DataKinds #-} {-# language FlexibleContexts #-} {-# language PartialTypeSignatures #-} {-# language OverloadedLabels #-} {-# language OverloadedStrings #-} {-# language TypeApplications #-} {-# OPTIONS_GHC -fno-warn-partial-type-signatures #-} module Main where import ...
frees-io/freestyle-rpc
modules/haskell-integration-tests/mu-haskell-client-server/protobuf-server/Main.hs
apache-2.0
2,250
0
11
566
576
306
270
54
3
module Coins.A263135Spec (main, spec) where import Test.Hspec import Coins.A263135 (a263135) main :: IO () main = hspec spec spec :: Spec spec = describe "A263135" $ it "correctly computes the first 20 elements" $ map a263135 [0..20] `shouldBe` expectedValue where expectedValue = [0,0,1,2,3,4,6,7,8,9,...
peterokagey/haskellOEIS
test/Coins/A263135Spec.hs
apache-2.0
354
0
8
61
157
94
63
10
1
-- Copyright 2012-2014 Samplecount S.L. -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agr...
samplecount/shake-language-c
src/Development/Shake/Language/C/Host/Linux.hs
apache-2.0
1,375
0
12
255
226
129
97
20
5
module Sol1 where import GS -- 1.9 maxInt :: [Int] -> Int maxInt [] = error "empty list" maxInt [x] = x maxInt (x:xs) = max x (maxInt xs) -- 1.10 removeFst :: [Int] -> Int -> [Int] removeFst [] y = [] removeFst (x:xs) y | x == y = xs | otherwise = x:remo...
bartolkaruza/software-testing-2014-group-W1
week1/week_1_group_w1/Sol1.hs
apache-2.0
1,655
0
9
565
742
390
352
40
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QGLFramebufferObject.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:36 Warning : this file is machine generat...
keera-studios/hsQt
Qtc/Enums/Opengl/QGLFramebufferObject.hs
bsd-2-clause
2,489
0
18
532
612
313
299
55
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Setup -- Copyright : Isaac Jones 2003-2004 -- Duncan Coutts 2007 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell...
sopvop/cabal
Cabal/Distribution/Simple/Setup.hs
bsd-3-clause
86,958
0
47
23,247
17,601
9,888
7,713
1,650
10
{-# LANGUAGE OverloadedStrings, FlexibleContexts #-} module Aws.SimpleDb.Model where import Aws.SimpleDb.Response import Aws.Util import Aws.Xml import Control.Monad import Text.XML.Cursor (($/), (&|)) import qualified Control.Failure as F import ...
jgm/aws
Aws/SimpleDb/Model.hs
bsd-3-clause
3,217
0
12
581
1,002
544
458
60
1
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE TupleSections #-} module Bertrand.Parser (parse )where import Prelude hiding (null) import Control.Applicative import Control.Monad -- import Control.Monad.Trans.Maybe -- import Control.Monad.State import Data.Char import qualified Data.Map as M import Data.Maybe -- i...
fujiy00/bertrand
src/Bertrand/Parser.hs
bsd-3-clause
11,294
1
22
4,243
4,537
2,380
2,157
246
10
module Generate.Functions where import Data.Char import Data.Maybe import Control.Applicative import Control.Exception(assert) import Data.XCB import HaskellCombinators import Generate(valueParamName,mapAlt,xImport,mapIdents,fieldName,fieldType) import Generate.Monad import Generate.Facts import Generate.Util imp...
aslatter/xhb
build-utils/src/Generate/Functions.hs
bsd-3-clause
13,073
0
14
3,958
2,811
1,458
1,353
257
4
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE MultiWayIf #-} module Game.Monsters.MTank where import Control.Lens (use, preuse, ix, zoom, (^.), (.=), (%=), (&), (.~), (%~)) import Control.Monad (void, when, unless, liftM) import Data.Bits ((.&.), (.|.), complement) import Linear (V3(..), normalize) import qualified ...
ksaveljev/hake-2
src/Game/Monsters/MTank.hs
bsd-3-clause
32,835
0
25
9,752
9,471
4,838
4,633
-1
-1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[PatSyntax]{Abstract Haskell syntax---patterns} -} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE StandaloneDerivi...
mettekou/ghc
compiler/hsSyn/HsPat.hs
bsd-3-clause
29,415
0
18
9,004
4,987
2,714
2,273
321
21
module CNC.GParser(module CNC.GTypes, parseIsoFile) where import CNC.GTypes import Data.Attoparsec.Text import qualified Data.Text as T import qualified Data.Text.Lazy as T import qualified Data.Text.Lazy.IO as T import Data.Char import Control.Applicative import Data.Maybe instrP = do c <- toUpper <$> letter va...
akamaus/gcodec
src/CNC/GParser.hs
bsd-3-clause
1,681
0
16
513
569
274
295
57
2
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE LambdaCase #-} {-# LANGUA...
GaloisInc/stack
src/Stack/Config.hs
bsd-3-clause
20,212
0
30
5,960
4,472
2,248
2,224
393
7
{-# LANGUAGE OverloadedStrings #-} module Main where import GHC.IO.Exception (ExitCode(..)) import System.Exit (die) import Data.Monoid ((<>)) import Control.Applicative (empty) import Data.Aeson import Turtle.Prelude (procStrictWithErr, shell) import qualified Data.ByteString.Lazy as BS import System.Directory (getA...
alexander-at-github/eta
tests/packages/Test.hs
bsd-3-clause
1,599
0
16
313
518
273
245
46
2
----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Init.Heuristics -- Copyright : (c) Benedikt Huber 2009 -- License : BSD-like -- -- Maintainer : cabal-devel@haskell.org -- Stability : provisional -- Portability : portable -- -- Heuris...
plumlife/cabal
cabal-install/Distribution/Client/Init/Heuristics.hs
bsd-3-clause
14,315
0
20
3,520
3,416
1,845
1,571
251
4
{-# LANGUAGE DeriveGeneric #-} module Competition where import Data.Aeson import GHC.Generics data Competition = Competition { id :: Int , caption :: String , league :: String , year :: String , currentMatchday :: Int , numberOfMatchdays :: Int , numberOfTeams :: Int , numberOfGames :: Int , lastUp...
julienXX/football-data-client
src/Competition.hs
bsd-3-clause
658
0
8
146
186
112
74
28
0
module Arp (doArp, main) where import Control.Concurrent import qualified Data.Map as Map import Data.ByteString.Lazy (ByteString) import Data.Word import Frenetic.NetCore import Frenetic.NetworkFrames (arpReply) import MacLearning (learningSwitch) import System.Log.Logger type IpMap = Map.Map IPAddress EthernetAddre...
frenetic-lang/netcore-1.0
examples/Arp.hs
bsd-3-clause
7,162
0
28
2,139
972
499
473
-1
-1
{-# LANGUAGE GADTs, DataKinds, TypeFamilies #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell#-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} module QueryAlgebras where import Types import Control.Error import Control.Monad.Free import Data.Singletons.TH data VFCrudable = User...
martyall/freeapi
src/QueryAlgebras.hs
bsd-3-clause
5,384
0
13
1,156
1,568
805
763
104
1
-- The @FamInst@ type: family instance heads {-# LANGUAGE CPP, GADTs #-} module FamInst ( FamInstEnvs, tcGetFamInstEnvs, checkFamInstConsistency, tcExtendLocalFamInstEnv, tcLookupFamInst, tcLookupDataFamInst, tcLookupDataFamInst_maybe, tcInstNewTyCon_maybe, tcTopNormaliseNewTyp...
urbanslug/ghc
compiler/typecheck/FamInst.hs
bsd-3-clause
16,229
0
14
4,715
2,539
1,349
1,190
206
3
module Main(main) where import System.Environment import System.IO import CCodeGen import Lexer import Parser import Program main :: IO () main = do (fileName:rest) <- getArgs fileHandle <- openFile fileName ReadMode programText <- hGetContents fileHandle putStrLn programText let compiledProg = compile pro...
dillonhuff/IntLang
src/Main.hs
bsd-3-clause
654
0
10
113
196
99
97
23
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeFamilyDependencies #-} module Data.Diverse.WhichSpe...
louispan/data-diverse
test/Data/Diverse/WhichSpec.hs
bsd-3-clause
13,143
0
23
4,838
4,320
2,237
2,083
-1
-1
{-# LANGUAGE MultiParamTypeClasses , DefaultSignatures , FlexibleInstances , TypeSynonymInstances , OverlappingInstances #-} -- |Used as the context for diagrams-ghci module MyPrelude () where import Prelude import Data.List (intersperse) import Data.Ratio import Diagrams.Prelude import Diagrams.Back...
mgsloan/diagrams-ghci
MyPrelude.hs
bsd-3-clause
2,872
0
16
613
1,051
544
507
65
1
import System.Nemesis import System.Nemesis.Utils ((-)) import Prelude hiding ((-)) main = run - do -- desc is optional, it gives some description to the task -- task syntax: task "keyword: space seperated dependencies" io-action desc "Hunter attack macro" task "attack: pet-attack auto-attack" (putStrLn "atta...
nfjinjing/nemesis
test/N2.hs
bsd-3-clause
574
0
11
118
127
59
68
15
1
----------------------------------------------------------------------------- -- | -- Module : Data.FMList -- Copyright : (c) Sjoerd Visscher 2009 -- License : BSD-style (see the file LICENSE) -- -- Maintainer : sjoerd@w3future.com -- Stability : experimental -- Portability : portable -- -- FoldMap ...
sjoerdvisscher/fmlist
Data/FMList.hs
bsd-3-clause
11,902
0
14
3,064
3,644
1,979
1,665
214
2
module Main where import Criterion.Main import GenStrat import CoreS.Parse import CoreS.AST import qualified CoreS.ASTUnitype as AST import AlphaR import NormalizationStrategies hiding ((<>)) import EvaluationMonad import SolutionContext normalizations :: Normalizer CompilationUnit normalizations = [ alphaRenaming ] ...
Centril/DATX02-17-26
bench/BenchAlpha.hs
gpl-2.0
814
0
12
127
235
124
111
26
1
module Snap.Snaplet.HandleIt.Router where import Snap(Handler, Initializer, addRoutes) import Snap.Snaplet.HandleIt.Header import Snap.Snaplet.HandleIt.Internal.Router import Snap.Snaplet.Heist(HasHeist(..)) import qualified Data.ByteString.Char8 as BS import Control.Monad.State(put, get) -- | resources adds all rest...
AtticHacker/snaplet-handle-it
src/Snap/Snaplet/HandleIt/Router.hs
gpl-3.0
1,216
0
11
295
368
197
171
27
1
module HplProducts.Test where import CK.Types import CK.Parsers.XML.XmlConfigurationKnowledge import CK.Parsers.XML.XmlConfigurationParser import FeatureModel.Types hiding (Success, Fail) import FeatureModel.Parsers.Expression import FeatureModel.Parsers.GenericParser import qualified BasicTypes as Core import System.D...
alessandroleite/hephaestus-pl
src/meta-hephaestus/HplProducts/Test.hs
lgpl-3.0
6,872
0
23
2,022
1,836
939
897
-1
-1
{-# OPTIONS_GHC -fno-warn-orphans #-} module Test.Pos.Cbor.Arbitrary.UserSecret ( ) where import Universum import Test.QuickCheck (Arbitrary (..)) import Test.QuickCheck.Arbitrary.Generic (genericArbitrary, genericShrink) import Pos.Util.Use...
input-output-hk/cardano-sl
lib/test/Test/Pos/Cbor/Arbitrary/UserSecret.hs
apache-2.0
633
0
8
157
118
72
46
-1
-1
{-# LANGUAGE OverloadedStrings #-} -- | Home/landing page. module HL.View.Home where import HL.View import HL.View.Code import HL.View.Home.Features import HL.View.Template -- | Home view. homeV :: [(Text, Text, Text)] -> FromLucid App homeV vids = skeleton "Haskell Language" (\_ _ -> linkcss "http...
josefs/hl
src/HL/View/Home.hs
bsd-3-clause
7,563
0
27
2,855
1,559
759
800
129
1
-- | -- Module : Data.ASN1.Types -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE BangPatterns #-} module Data.ASN1.Types ( -- * Raw types ASN1Class(..) , ASN1...
mboes/hs-asn1
data/Data/ASN1/Types.hs
bsd-3-clause
2,624
0
7
774
304
192
112
51
0
{-# OPTIONS -O #-} --- {-# OPTIONS_GHC -XFlexibleContexts #-} see Makefile -- Author: Pawel Bulkowski (pawelb16@gmail.com) -- Thanks to Michal Palka for teaching me Haskell -- Photos by: Magdalena Niedziela -- based on other gtk2hs example applications -- the code is public domain import Graphics.UI.Gtk import Graphi...
mariefarrell/Hets
glade-0.12.5.0/demo/scaling/Scaling.hs
gpl-2.0
27,522
0
23
7,067
10,197
4,889
5,308
-1
-1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 -} {-# LANGUAGE CPP #-} module VarSet ( -- * Var, Id and TyVar set types VarSet, IdSet, TyVarSet, CoVarSet, TyCoVarSet, -- ** Manipulating these sets emptyVarSet, unitVarSet, mkVarSet, ...
oldmanmike/ghc
compiler/basicTypes/VarSet.hs
bsd-3-clause
9,744
0
10
2,188
1,844
1,062
782
173
1
module Turbinado.Database.ORM.Types where import qualified Data.Map as M import Database.HDBC type TypeName = String -- -- * Types for the Table descriptions -- type Tables = M.Map TableName (Columns, PrimaryKey) type TableName = String type Columns = M.Map ColumnName ColumnDesc type ColumnName = String type Primary...
alsonkemp/turbinado-website
Turbinado/Database/ORM/Types.hs
bsd-3-clause
532
0
6
77
120
79
41
12
0
{-# OPTIONS -fglasgow-exts #-} module BinaryDerive where import Data.Generics import Data.List deriveM :: (Typeable a, Data a) => a -> IO () deriveM (a :: a) = mapM_ putStrLn . lines $ derive (undefined :: a) derive :: (Typeable a, Data a) => a -> String derive x = "instance " ++ context ++ "Binary " ++ inst ...
beni55/binary
tools/derive/BinaryDerive.hs
bsd-3-clause
2,264
4
18
739
863
454
409
-1
-1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="it-IT"> <title>Alert Filters | ZAP Extension</title> <maps> <homeID>top</homeID> <mapre...
kingthorin/zap-extensions
addOns/alertFilters/src/main/javahelp/org/zaproxy/zap/extension/alertFilters/resources/help_it_IT/helpset_it_IT.hs
apache-2.0
974
78
66
159
413
209
204
-1
-1
{-# LANGUAGE CPP, GADTs #-} ----------------------------------------------------------------------------- -- -- Generating machine code (instruction selection) -- -- (c) The University of Glasgow 1996-2004 -- ----------------------------------------------------------------------------- -- This is a big module, but, i...
oldmanmike/ghc
compiler/nativeGen/PPC/CodeGen.hs
bsd-3-clause
73,920
0
28
26,172
18,496
9,131
9,365
-1
-1
module Compose where {-@ cmp :: forall < p :: b -> c -> Prop , q :: a -> b -> Prop , r :: a -> c -> Prop >. {x::a, w::b<q x> |- c<p w> <: c<r x>} f:(y:b -> c<p y>) -> g:(z:a -> b<q z>) -> x:a -> c<r x> @-} cmp :: (b -> c) -> (a -> b) -> a -> c...
mightymoose/liquidhaskell
benchmarks/icfp15/neg/Composition.hs
bsd-3-clause
1,474
0
8
493
287
162
125
23
1
{-# LANGUAGE TypeFamilies, PatternGuards, CPP #-} module Yesod.Core.Internal.LiteApp where #if __GLASGOW_HASKELL__ < 710 import Data.Monoid #endif import Yesod.Routes.Class import Yesod.Core.Class.Yesod import Yesod.Core.Class.Dispatch import Yesod.Core.Types import Yesod.Core.Content import Data.Text (Text) import We...
MaxGabriel/yesod
yesod-core/Yesod/Core/Internal/LiteApp.hs
mit
2,542
0
14
596
906
472
434
66
2
{-| Ganeti logging functions expressed using MonadBase This allows to use logging functions without having instances for all possible transformers. -} {- Copyright (C) 2014 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that ...
apyrgio/ganeti
src/Ganeti/Logging/Lifted.hs
bsd-2-clause
2,867
0
9
518
466
258
208
37
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Bool -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer :...
beni55/haste-compiler
libraries/ghc-7.8/base/Data/Bool.hs
bsd-3-clause
919
0
6
203
93
73
20
8
0
module D where data T = A Int | B Float deriving Eq f x = x + 1
urbanslug/ghc
testsuite/tests/ghci/prog001/D2.hs
bsd-3-clause
66
0
6
21
33
19
14
3
1
{-# LANGUAGE OverloadedStrings #-} module HelpMenu (helpMenu, HelpT, helpWidgit) where import Graphics.Vty hiding (pad) import Graphics.Vty.Widgets.All import System.Exit ( exitSuccess ) -- Visual attributes. msgAttr :: Attr msgAttr = fgColor blue data HelpT = HelpT { helpWidgit :: Widget (VCentered (HCentered ...
alterapraxisptyltd/serialterm
src/HelpMenu.hs
isc
1,028
0
15
278
250
132
118
23
2
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.EXTBlendMinMax (pattern MIN_EXT, pattern MAX_EXT, EXTBlendMinMax(..), gTypeEXTBlendMinMax) where i...
ghcjs/jsaddle-dom
src/JSDOM/Generated/EXTBlendMinMax.hs
mit
1,104
0
6
135
318
210
108
21
0
-- 1. It’s not a typo, we’re just being cute with the name. data TisAnInteger = TisAn Integer instance Eq TisAnInteger where (==) (TisAn a) (TisAn b) = a == b --2. data TwoIntegers = Two Integer Integer instance Eq TwoIntegers where (==) (Two a b) (Two a' b') = a == a' && b == b' -- 3. data StringOrInt = TisAnI...
diminishedprime/.org
reading-list/haskell_programming_from_first_principles/06_12.hs
mit
1,184
0
8
288
620
335
285
28
0
main = putStrLn . show. sum $ [ x | x <- [1..999], (x `mod` 3) == 0 || (x `mod` 5) == 0]
clementlee/projecteuler-haskell
p1.hs
mit
89
0
12
24
68
38
30
1
1
module Graphics.Layouts ( fixedLayout, borderLayout, AnchorConstraint(..), anchorLayout, adaptativeLayout, ) where import Data.Maybe import Data.Tree import Data.Tree.Zipper import Graphics.Rendering.OpenGL import Graphics.View --------------------------------------------------------------------...
Chatanga/kage
src/Graphics/Layouts.hs
mit
5,724
0
23
2,070
1,237
671
566
68
7
{-# LANGUAGE DeriveGeneric #-} module Handler.Account where import Import import Yesod.Auth.Simple (setPasswordR) import Util.Slug (mkSlug) import Util.User (newToken) import Util.Handler (title) import Util.Alert (successHtml) import qualified Model.Snippet.Api as SnippetApi import qualified Model.Run.Api as RunApi ...
vinnymac/glot-www
Handler/Account.hs
mit
1,929
0
13
387
543
266
277
52
1
module Main where {- A Tic-Tac-Toe Board 012 345 678 -} import TTT.GameLogic as GL main :: IO () main = print $ GL.hasWon 012
tripattern/haskell
ticTacToe/src/Main.hs
mit
138
0
7
37
36
21
15
5
1
{-| Module : Database.Orville.PostgreSQL.Internal.Select Copyright : Flipstone Technology Partners 2016-2018 License : MIT -} module Database.Orville.PostgreSQL.Internal.Select where import Control.Monad.Reader import qualified Data.List as List import Database.HDBC import Database.Orville.PostgreSQL.Internal.Ex...
flipstone/orville
orville-postgresql/src/Database/Orville/PostgreSQL/Internal/Select.hs
mit
2,552
0
10
448
515
287
228
51
1
module Solar.Caster.Client where
Cordite-Studios/solar
solar-wind/Solar/Caster/Client.hs
mit
33
0
3
3
7
5
2
1
0
module Exercise where money :: Int -> [[Int]] money 0 = [[]] money n = [(k:rest) | k <- [1,2,5,10,20,50], k <= n, rest <- (money (n - k)), k <= minimum (n:rest), -- ordering does not matter n == sum (k:rest) ]...
tcoenraad/functioneel-programmeren
2014/opg1b.hs
mit
321
0
11
154
142
79
63
8
1
------------------------------------------------------------------------------ -- | -- Module : Hajong.Server.Config -- Copyright : (C) 2016 Samuli Thomasson -- License : %% (see the file LICENSE) -- Maintainer : Samuli Thomasson <samuli.thomasson@paivola.fi> -- Stability : experimental -- ...
SimSaladin/hajong
hajong-server/src/Hajong/Server/Config.hs
mit
2,149
0
14
475
369
208
161
-1
-1
module Yi.Keymap.Vim.Digraph ( charFromDigraph , defDigraphs ) where import Control.Applicative charFromDigraph :: [(String, Char)] -> Char -> Char -> Maybe Char charFromDigraph digraphTable c1 c2 = lookup [c1, c2] digraphTable <|> lookup [c2, c1] digraphTable defDigraphs :: [(String, Char)] defDigra...
atsukotakahashi/wi
src/library/Yi/Keymap/Vim/Digraph.hs
gpl-2.0
1,459
0
8
503
602
392
210
64
1
-- Copyright (C) 2002-2003 David Roundy -- -- 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 Software Foundation; either version 2, or (at your option) -- any later version. -- -- This program is distributed ...
DavidAlphaFox/darcs
src/Darcs/Patch/Named.hs
gpl-2.0
8,981
1
14
2,289
3,008
1,588
1,420
-1
-1
{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-} {-# OPTIONS_GHC -w #-} module GTFS.Realtime.Internal.Com.Google.Transit.Realtime.TripDescriptor.ScheduleRelationship (ScheduleRelationship(..)) where import Prelude ((+), (/), (.)) import quali...
romanofski/gtfsschedule
src/GTFS/Realtime/Internal/Com/Google/Transit/Realtime/TripDescriptor/ScheduleRelationship.hs
gpl-3.0
3,470
0
11
614
784
437
347
73
1
module FQuoter.Repl.ReplForms (shellForNotDefined) where import Control.Applicative import Control.Monad import System.Console.Haskeline import qualified Data.Map as Map import FQuoter.Quote import FQuoter.Parser.ParserTypes import FQuoter.Repl.ReplUtils shellForNotDefined :: NotDefinedType -> InputT IO ParsedType ...
Raveline/FQuoter
src/FQuoter/Repl/ReplForms.hs
gpl-3.0
2,184
0
14
785
458
230
228
46
2
{-# LANGUAGE FlexibleInstances, OverloadedStrings, MultiParamTypeClasses, TypeSynonymInstances #-} module Carbon.Data.ResultSet where import Control.Applicative import Control.Arrow (first, second) import Control.Monad import Data.Aeson ((.=), ToJSON(..), object, FromJSON(..), Value(..), (.:)) import Data.Aeson.Types ...
runjak/carbon-adf
Carbon/Data/ResultSet.hs
gpl-3.0
7,857
0
17
1,997
2,808
1,493
1,315
163
1
module TodoTree.Dispatch where -- import Control.Monad (when) import System.Console.Docopt.NoTH import TodoTree.Repl (repl) dispatchOrExit :: String -> [String] -> IO () dispatchOrExit usg args = do doc <- parseUsageOrExit usg opts <- parseArgsOrExit doc args dispatch doc opts dispatch :: Docopt -> Arguments -...
jefdaj/todotree
src/TodoTree/Dispatch.hs
gpl-3.0
515
0
11
97
162
81
81
12
1
{- The authors ask: 2. Write a function, lastButOne , that returns the element before the last. -} lastButOne :: [a] -> a lastButOne xs = last (take ((length xs) - 1) xs)
craigem/RealWorldHaskell
ch02/lastButOne.hs
gpl-3.0
172
0
11
34
46
24
22
2
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-games/gen/Network/Google/Resource/Games/Applications/Played.hs
mpl-2.0
4,219
0
17
999
636
372
264
92
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-sourcerepo/gen/Network/Google/Resource/SourceRepo/Projects/Repos/Patch.hs
mpl-2.0
4,945
0
16
1,153
776
453
323
112
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-adexchange-buyer/gen/Network/Google/Resource/AdExchangeBuyer/PerformanceReport/List.hs
mpl-2.0
5,076
0
16
1,134
672
391
281
101
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-accesscontextmanager/gen/Network/Google/Resource/AccessContextManager/AccessPolicies/Patch.hs
mpl-2.0
5,942
0
17
1,334
861
503
358
123
1
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE LambdaCase #-} module TimWilliamsStreaming where import Control.Monad.Trans -- ListT done right -- list elements 'a' interleaved with effect 'm' newtype ListT (m :: * -> *) (a :: *) = ListT { runListT ::...
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/streaming/2018-10-tim-williams-streaming-haskellX/src/TimWilliamsStreaming.hs
unlicense
2,175
0
13
542
797
427
370
41
2
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {- hsCRD...
ssoudan/hsCRDT
src/CRDT.hs
apache-2.0
1,946
0
9
392
249
142
107
25
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} -- | Data types for K3 dataflow provenance module Language.K3.Analysis.Provenance.Core where import Control.DeepSeq import GHC.Generics (Generic) import Data.Binary import Data.Serializ...
DaMSL/K3
src/Language/K3/Analysis/Provenance/Core.hs
apache-2.0
4,165
0
18
1,050
993
533
460
115
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QTextLayout.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:15 Warning : this file is machine generated - do n...
uduki/hsQt
Qtc/Gui/QTextLayout.hs
bsd-2-clause
18,021
0
14
2,890
5,620
2,870
2,750
-1
-1
{-# OPTIONS_GHC -Wall -Werror #-} module IRTS.CLaSH.Show where import Core.CaseTree import Core.TT showSC :: SC -> String showSC (STerm t) = showTerm t showSC (Case n alts) = "Case " ++ show n ++ " of " ++ unlines (map showAlt alts) showSC sc = "showSC: " ++ show sc showAlt :: CaseAlt -> String showA...
christiaanb/Idris-dev
src/IRTS/CLaSH/Show.hs
bsd-3-clause
2,225
0
11
562
849
418
431
49
1