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
module Pos.Chain.Block ( module X ) where import Pos.Chain.Block.Block as X import Pos.Chain.Block.ComponentBlock as X import Pos.Chain.Block.Configuration as X import Pos.Chain.Block.Error as X import Pos.Chain.Block.Genesis as X import Pos.Cha...
input-output-hk/pos-haskell-prototype
chain/src/Pos/Chain/Block.hs
mit
659
0
4
204
130
100
30
15
0
{-# LANGUAGE CPP #-} module ETA.TypeCheck.TcCanonical( canonicalize, unifyDerived, StopOrContinue(..), stopWith, continueWith ) where import ETA.TypeCheck.TcRnTypes import ETA.TypeCheck.TcType import ETA.Types.Type import ETA.Types.Kind import ETA.TypeCheck.TcFlatten import ETA.TypeCheck.TcSMonad imp...
pparkkin/eta
compiler/ETA/TypeCheck/TcCanonical.hs
bsd-3-clause
72,869
119
25
20,191
10,533
5,503
5,030
-1
-1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[TcBinds]{TcBinds} -} {-# LANGUAGE CPP, RankNTypes, ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} module TcBinds ( tcLocalBinds, tcTopBinds, tcRecSelBinds, tcValBinds, tcHsBootSigs, tc...
snoyberg/ghc
compiler/typecheck/TcBinds.hs
bsd-3-clause
73,217
0
19
22,105
11,991
6,274
5,717
837
8
{-# LANGUAGE TemplateHaskell, CPP, DeriveFunctor, DeriveFoldable, DeriveTraversable #-} {-| Implementation of the Ganeti Query2 language. -} {- Copyright (C) 2012 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided t...
andir/ganeti
src/Ganeti/Query/Language.hs
bsd-2-clause
15,955
0
14
3,659
3,269
1,772
1,497
260
3
-- (c) The University of Glasgow 2006 {-# LANGUAGE CPP #-} module OptCoercion ( optCoercion, checkAxInstCo ) where #include "HsVersions.h" import Coercion import Type hiding( substTyVarBndr, substTy, extendTvSubst ) import TcType ( exactTyVarsOfType ) import TyCon import CoAxiom import Var import VarSet impor...
TomMD/ghc
compiler/types/OptCoercion.hs
bsd-3-clause
27,224
0
15
6,654
6,342
3,216
3,126
-1
-1
{- Install microbench to build this program: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/microbench % ghc -O --make benchmark % ./benchmark [1 of 1] Compiling Main ( benchmark.hs, benchmark.o ) Linking benchmark ... * insNode into AVL tree: .................. 8.877ns per it...
scolobb/fgl
test/benchmark.hs
bsd-3-clause
3,622
0
11
1,071
820
411
409
70
1
-- | Types for the general graph colorer. {-# 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/wik...
nomeata/ghc
compiler/utils/GraphBase.hs
bsd-3-clause
3,073
80
10
665
475
287
188
45
1
{-# LANGUAGE PolyKinds, DataKinds, TemplateHaskell, TypeFamilies #-} module TH_TyInstWhere2 where import Language.Haskell.TH $( do { decs <- [d| type family F (a :: k) (b :: k) :: Bool where F a a = True F a b = False |] ; reportWarning (pprint decs) ; return [...
urbanslug/ghc
testsuite/tests/th/TH_TyInstWhere2.hs
bsd-3-clause
327
0
11
110
53
30
23
8
0
module Network.Campfire.Room where import Network.Campfire.Common -- | Request type for getting 'Room's visible to authenticated user. See -- <https://github.com/37signals/campfire-api/blob/master/sections/rooms.md#get-rooms> -- for additional information. data GetRooms = GetRooms deriving (Show, Eq) -...
joshmcgrath08/campfire-lib
Network/Campfire/Room.hs
mit
3,939
0
12
680
729
392
337
-1
-1
{-# LANGUAGE NoMonomorphismRestriction #-} module Dados where import Data.List (transpose, foldl1', sortBy, groupBy) import Control.Parallel import Control.Parallel.Strategies type ChunksOf a = [a] -- | operações de mapeamento e combinação ordenaTupla :: (Ord a) => (a, t) -> (a, t) -> Ordering ordenaTupla (a1,b1) ...
folivetti/BIGDATA
Bibliotecas/Dados.hs
mit
2,189
0
10
733
949
513
436
51
1
module BACnet.PrimSpec where import Test.Hspec import Test.QuickCheck import BACnet.Prim import Control.Exception (evaluate) import Data.Maybe (fromJust) spec :: SpecWith () spec = describe "testBit" $ do context "when given (BitString 0 [0xF0])" $ do let bs = fromJust $ bitString 0 [0xF0] ...
michaelgwelch/bacnet
test/BACnet/PrimSpec.hs
mit
1,255
0
18
373
338
169
169
30
1
-- Combinations -- http://www.codewars.com/kata/54492291ec342c4a440008c5/ module Combinations where combinations :: Int -> [a] -> [[a]] combinations 0 _ = [[]] combinations _ [] = [] combinations n (x:xs) = [ x:c | c <- combinations (n-1) xs] ++ (combinations n xs)
gafiatulin/codewars
src/6 kyu/Combinations.hs
mit
268
0
11
42
113
62
51
5
1
import Development.Shake import Development.Shake.Command import Development.Shake.FilePath import Development.Shake.Util main :: IO () main = shakeArgs shakeOptions{shakeFiles="_build"} $ do want ["_build/index.html"] -- Common Pandoc args let args = [ "--bibliography=docs/bibliography.yaml",...
sgillespie/adhoc-continuous-integration
Build.hs
mit
838
0
14
251
161
84
77
25
1
module MultA where multA1 = [[2,3],[4,5]] myFun00 = two * five where two = head $ head multA1 five = head $ tail $ head $ tail multA1 ten = (two * five)
HaskellForCats/HaskellForCats
MultDemArr.hs
mit
178
1
10
58
83
47
36
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} module Advent.Day5 where import BasePrelude import Data.List.Split atLeastNVowels :: Integer -> String -> Bool atLeastNVowels n = (>= n) . genericLength . filter (`elem` "aeiou") pairWithOffset :: Integer -> String -> Bool pairWithOffset offset str = or $ zipWith (==) (g...
jhenahan/adventofcode
src/Advent/Day5.hs
mit
1,563
0
12
412
525
283
242
39
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Monad ( foldM, when ) import Data.IntSet as IS import qualified Data.List.NonEmpty as NL import qualified Data.Map as M import System.Random ( randomIO ) import ...
lpeterse/haskell-mqtt
test/TrieSizeTest.hs
mit
1,706
0
15
482
464
254
210
31
2
{-# LANGUAGE ExistentialQuantification, DeriveDataTypeable #-} -- | -- -- Module : DataAssociation.PostProcess -- Description : Post processing generated 'AssocRule's. -- License : MIT -- -- -- module DataAssociation.PostProcess ( PostProcess(..) , postProcess , PostProcessDescription(..) , PostProces...
fehu/min-dat--a-priori
core/src/DataAssociation/PostProcess.hs
mit
4,465
0
11
1,031
1,302
695
607
-1
-1
module Yacht (yacht, Category(..)) where data Category = Ones | Twos | Threes | Fours | Fives | Sixes | FullHouse | FourOfAKind | LittleStraight | BigStraight | Choice ...
exercism/xhaskell
exercises/practice/yacht/src/Yacht.hs
mit
433
0
7
205
85
52
33
15
1
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.CSSPrimitiveValue (setFloatValue, getFloatValue, getFloatValue_, setStringValue, getStringValue, getStrin...
ghcjs/jsaddle-dom
src/JSDOM/Generated/CSSPrimitiveValue.hs
mit
6,793
0
14
1,023
1,534
846
688
117
1
module Rebase.Data.Vector.Generic.New ( module Data.Vector.Generic.New ) where import Data.Vector.Generic.New
nikita-volkov/rebase
library/Rebase/Data/Vector/Generic/New.hs
mit
113
0
5
12
26
19
7
4
0
triangles = [ (a, b, c) | c <- [ 1 .. 10 ], b <- [ 1 .. 10 ], a <- [ 1 .. 10 ] ] rightTriangles = [ (a, b, c) | c <- [ 1 .. 10 ], b <- [ 1 .. c ], a <- [ 1 .. b ], a^2 + b^2 == c^2 ] rightTriangles' = [ (a, b, c) | c <- [ 1 .. 10 ], b <- [ 1 .. c ], a <- [ 1 .. b ], a^2 + b^2 == c^2, a + b + c == 24 ]
afronski/playground-fp
books/learn-you-a-haskell-for-great-good/starting-out/triangles.hs
mit
302
0
11
103
242
137
105
3
1
module PGIP.GraphQL.Resolver.ToResult where import PGIP.GraphQL.Result.Axiom as GraphQLResultAxiom import PGIP.GraphQL.Result.Action as GraphQLResultAction import PGIP.GraphQL.Result.Conjecture as GraphQLResultConjecture import PGIP.GraphQL.Result.ConservativityStatus as GraphQLResultConservativityStatus import PGIP.G...
spechub/Hets
PGIP/GraphQL/Resolver/ToResult.hs
gpl-2.0
24,595
0
20
4,960
3,999
2,158
1,841
407
1
module Probability.ConditionalProbability where import Notes import Logic.FirstOrderLogic.Macro import Logic.PropositionalLogic.Macro import Sets.Partition.Terms import Probability.Intro.Macro import Probability.Intro.Terms import Probability.Prob...
NorfairKing/the-notes
src/Probability/ConditionalProbability.hs
gpl-2.0
8,668
1
32
3,473
3,712
1,854
1,858
187
1
module Main where import Data.Foldable (forM_) main :: IO () main = do forM_ [1..98] (let eat_pie = "eat pie" in \ _ -> return eat_pie) let x = iterate ('a' :) [] !! 1000000 let squiggly = sqrt 5 putStr "hi\n"
GaProgMan/Hi-n
hi.hs
gpl-2.0
220
0
12
52
106
53
53
8
1
-- Copyright (C) 2002-2004 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 in the...
DavidAlphaFox/darcs
src/Darcs/Patch/Viewing.hs
gpl-2.0
7,301
0
23
2,327
2,120
1,099
1,021
-1
-1
module Process where import Math.ExpPairs.Process import Test.Tasty import Test.Tasty.SmallCheck as SC import Test.Tasty.QuickCheck as QC hiding (Positive) import Instances () testReadShow :: Path -> Bool testReadShow p@(Path _ xs) = read (concatMap show xs) == p testOrd :: Path -> Path -> Bool testOrd p1 p2 = com...
Bodigrim/exp-pairs
tests/Process.hs
gpl-3.0
938
0
13
187
372
205
167
21
1
module P22CompNums where import Library main :: IO () main = do x <- promptNonNegInt "How many integers will you enter? " is <- getUniqInts x [] putStrLn $ case maxInt is of Nothing -> "No largest integer found" Just n -> "The largest integer was: " ++ show n -- Get s...
ciderpunx/57-exercises-for-programmers
src/P22CompNums.hs
gpl-3.0
900
0
12
289
318
160
158
22
2
{-# LANGUAGE FlexibleContexts, KindSignatures, NoMonomorphismRestriction, RankNTypes #-} {-- Defines format of SecPAL queries -} module Logic.SecPAL.Query where import Control.Applicative ((<*), (*>), (<$>)) import Data.Maybe import Logic.General.Entities import Logic.General.Parser import Logic.General.Pretty import ...
bogwonch/SecPAL
src/Logic/SecPAL/Query.hs
gpl-3.0
4,603
0
15
881
1,701
910
791
107
2
module Math.Arithmetic.Test (tests) where import Test.Framework.Providers.API import qualified Math.Arithmetic.Digits.Test as Digits import qualified Math.Arithmetic.Divisibility.Test as Divisibility import qualified Math.Arithmetic.Primality.Test as Primality import qualified Math.Arithmetic.Sequences.Test as Sequen...
sykora/zeta
test/Math/Arithmetic/Test.hs
gpl-3.0
544
0
7
84
112
73
39
12
1
module Gt.Net ( get_resp , get_resp_each_word ) where import Data.Maybe import Gt.Helpers (decodeString) import Gt.Langs import Network.URL import Network.HTTP trans_url :: Lang -> Lang -> String -> String trans_url sl tl text = exportURL $ foldl add_param base_url [("text", text), ("sl", sl),...
styx/gtc
Gt/Net.hs
gpl-3.0
776
0
12
140
223
119
104
19
1
{-| Module : Token Description : Token populates Cell of a Sudoku grid Copyright : (c) Frédéric BISSON 2015 License : GPL-3 Maintainer : zigazou@free.fr Stability : experimental Portability : POSIX This module handles Token. -} module Sudoku.Token ( Token (T1, T2, T3, T4, T5, T6, T7, T8, T9) , readToken ...
Zigazou/Sudoku
src/Sudoku/Token.hs
gpl-3.0
889
0
9
202
235
130
105
20
1
{- Copyright (C) 2014 Richard Larocque <richard.larocque@gmail.com> 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 of the License, or (at your option) any later version. This progr...
richardlarocque/latin-db-builder
Wiki/Markup.hs
gpl-3.0
4,102
4
16
815
1,245
577
668
125
8
{-# OPTIONS -Wall #-} module Data.List.Utils ( groupOn, sortOn, enumerate, enumerate2d, nth, index, removeAt, atPred, pairList ) where import Data.Function (on) import Data.List (groupBy, sortBy) import Data.Maybe (listToMaybe) import Data.Ord (comparing) groupOn :: Eq b => (a -> b) -> [a] -> [[a]] groupOn = groupB...
nimia/bottle
bottlelib/Data/List/Utils.hs
gpl-3.0
1,136
4
9
265
645
363
282
35
2
module Core (commandLine) where import Init import MpvFFI import Data.List.Split (splitOn) import Data.List (isPrefixOf,elemIndex) import Text.Read (readMaybe) import Control.Exception.Base (Exception,throwIO) import Control.Monad.State (StateT, runStateT, get, modify,lift) import Data.Either (rights) import SrtFile (...
redfish64/MpvLangLearn
Core.hs
gpl-3.0
3,807
0
19
1,034
1,126
557
569
93
3
-- count leaves of a binary tree data Tree a = Empty | Branch a (Tree a) (Tree a) p61 :: Tree a -> Int p61 Empty = 0 p61 (Branch _ Empty Empty) = 1 p61 (Branch _ l r) = p61 l + p61 r
yalpul/CENG242
H99/61-69/p61.hs
gpl-3.0
186
0
8
49
97
49
48
5
1
{- A typeclass that Wolf and Mallard will have to explicitly instantiate -} class Duck a where quack :: a -> String dance :: a -> String data Wolf = Wolf eat :: (Duck t) => Wolf -> t -> String eat _ _ = " 😈 " {- In order to become a duck, Wolf has to use the Adapter pattern. In - Haskell, typeclasses are Co...
arnobl/structural-typing-examples
src/staticTyping/nonStructural/haskell/duck.hs
gpl-3.0
1,107
0
10
266
282
139
143
26
1
module TestSuite where import Distribution.TestSuite import AudioDB.Test import AudioDB.Test.Types hiding (Test) import AudioDB.Evaluation import Control.Logging (withStderrLogging) import Data.List (permutations) testInMaybeRange :: TestInstance testInMaybeRange = TestInstance { run = return $ inRange , name ...
TransformingMusicology/adb-test-framework
tests/TestSuite.hs
gpl-3.0
14,636
0
15
4,443
2,818
1,689
1,129
303
2
import Data.List main = do src <- getContents putStrLn . concat . transpose . map (concat . words) . lines $ src
elterminad0r/cipher_tools
src/scripts/matrix.hs
gpl-3.0
122
0
12
31
51
25
26
4
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 #-} -- ...
olorin/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/DescribeGatewayInformation.hs
mpl-2.0
8,717
0
20
1,795
1,251
740
511
142
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-translate/gen/Network/Google/Resource/Translate/Projects/Locations/Glossaries/Get.hs
mpl-2.0
5,035
0
15
1,086
699
409
290
103
1
{-# LANGUAGE FlexibleContexts #-} module Codewars.Kata.Fold where foldTo :: Double -> Maybe Int foldTo distance = if distance > 0 then Just $ f 0.0001 else Nothing where f n = if n >= distance then 0 else 1 + f (n + n) --
ice1000/OI-codes
codewars/1-100/folding-your-way-to-the-moon.hs
agpl-3.0
228
0
11
51
84
46
38
5
3
-- Copyright (c) 2013-2014 PivotCloud, Inc. -- -- Aws.Lambda.Commands.GetFunctionConfiguration -- -- Please feel free to contact us at licensing@pivotmail.com with any -- contributions, additions, or other feedback; we would love to hear from -- you. -- -- Licensed under the Apache License, Version 2.0 (the "License");...
alephcloud/hs-aws-lambda
src/Aws/Lambda/Commands/GetFunctionConfiguration.hs
apache-2.0
2,236
0
10
302
212
138
74
34
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Openshift.V1.BuildList where import GHC.Generics import Data.Text import Openshift.Unversioned.ListMeta import Openshift.V1.Build import qualif...
minhdoboi/deprecated-openshift-haskell-api
openshift/lib/Openshift/V1/BuildList.hs
apache-2.0
1,162
0
9
172
125
77
48
19
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ParallelListComp #-} {-# LANGUAGE ScopedTypeVariables #-} {- Copyright 2020 The CodeWorld Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance...
google/codeworld
codeworld-compiler/src/CodeWorld/Compile/Requirements.hs
apache-2.0
5,164
12
20
1,182
1,389
727
662
125
1
-- Copyright 2020 Google LLC -- -- 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 agreed to in ...
google/hrepl
hrepl/tests/Basic.hs
apache-2.0
705
0
8
126
55
36
19
5
1
{- Copyright 2015 Rafał Nowak 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 agreed to in writing, software di...
rafalnowak/RaytracaH
src/RaytracaH/Primitive.hs
apache-2.0
2,888
0
12
583
702
383
319
51
3
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : Tools.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:14 Warning : this file is machine generated - do not mod...
uduki/hsQt
Qtc/Tools.hs
bsd-2-clause
731
0
5
119
77
54
23
12
0
{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} module Data.Coap ( module Data.Coap.Types , XEnum(..) , parseMessage ) where import qualified Data.ByteString.Lazy as BS import Debug.Trace (traceShowId, trace, traceM) impo...
Xandaros/coap
src/Data/Coap.hs
bsd-2-clause
6,215
0
16
1,549
2,041
1,058
983
144
17
{-# LANGUAGE ViewPatterns, TupleSections, RecordWildCards, ScopedTypeVariables, PatternGuards #-} module Action.Generate(actionGenerate) where import Control.Applicative import Data.List.Extra import System.FilePath import System.Directory.Extra import System.Time.Extra import Data.Tuple.Extra import qualified Data.B...
ndmitchell/hogle-dead
src/Action/Generate.hs
bsd-3-clause
2,557
0
24
591
774
409
365
64
4
module NumberWords where
FranklinChen/number-words-haskell
src/NumberWords.hs
bsd-3-clause
25
0
2
3
4
3
1
1
0
{-# LANGUAGE OverloadedStrings, TupleSections, ViewPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE TypeFamilies #-} module Text.HTML.TagStream.Text where import Control.Applicative import Control.Monad (unless, when, liftM) import qualified Control.Monad.Fail as Fail import Control.Monad.T...
yihuang/tagstream-conduit
Text/HTML/TagStream/Text.hs
bsd-3-clause
9,474
0
17
2,701
2,875
1,532
1,343
-1
-1
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE PolyKinds #-} -- | Type classes for folds data types module Data.Folds.Class ( -- * Category-lik...
Shimuuar/data-folds
Data/Folds/Class.hs
bsd-3-clause
7,879
0
15
1,824
2,608
1,394
1,214
164
2
-- | -- Module : Robotics.ROS.Msg.Class -- Copyright : Alexander Krupenkin 2016 -- License : BSD3 -- -- Maintainer : mail@akru.me -- Stability : experimental -- Portability : POSIX / WIN32 -- -- ROS message type class declaration. -- module Robotics.ROS.Msg.Class ( Message(..) , Stamped(..) ...
RoboticsHS/rosmsg
src/Robotics/ROS/Msg/Class.hs
bsd-3-clause
1,511
0
8
333
213
134
79
18
0
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} import LiquidHaskell import Language.Haskell.Liquid.Prelude (liquidAssert) [lq| invariant {v:Int | v >= 0} |] [lq| Decrease go 1 |] loop :: Int -> Int -> a -> (Int -> a -> a) -> a loop lo hi base f = go (hi-lo) base lo where go (d::Int) ac...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/rec_annot_go.hs
bsd-3-clause
424
0
11
116
177
96
81
12
1
{-| Module : Web.Lightning.Types Description : Re-exports main types. Copyright : (c) Connor Moreside, 2016 License : BSD-3 Maintainer : connor@moresi.de Stability : experimental Portability : POSIX Re-exports all the main types one is likely to need. -} module Web.Lightning.Types ( -- * Lightning...
cmoresid/lightning-haskell
src/Web/Lightning/Types.hs
bsd-3-clause
1,026
0
6
205
117
82
35
13
0
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE Rank2Types #-} module Horbits.Orbit.Properties (orbitSemiLatusRectum, orbitApoapsis, orbitApoapsisAltitude, orbitPeriapsis, orbitPeriapsisAltitude, orbitSemiMinorAxis, orbitPeriod, orbitSpecificEnergy, orbitVelocity, bodySolarDay) where import ...
chwthewke/horbits
src/horbits/Horbits/Orbit/Properties.hs
bsd-3-clause
3,802
0
15
906
1,174
589
585
-1
-1
-- | Application configuration for Himitsu. module Himitsu.Config where import System.Directory import System.FilePath import System.IO.Unsafe import Paths_himitsu appName :: String appName = "himitsu" {-# NOINLINE appDataDir #-} appDataDir :: FilePath appDataDir = unsafePerformIO $ do datadir <- getAppUserDataDire...
valderman/himitsu
src/Himitsu/Config.hs
bsd-3-clause
777
0
9
110
123
69
54
20
1
----------------------------------------------------------------------------- -- | -- Module : Berp.Base.StdTypes.Float -- Copyright : (c) 2010 Bernie Pope -- License : BSD-style -- Maintainer : florbitous@gmail.com -- Stability : experimental -- Portability : ghc -- -- The standard floating point type. -...
bjpop/berp
libs/src/Berp/Base/StdTypes/Float.hs
bsd-3-clause
2,987
0
10
502
729
423
306
69
4
{-# LANGUAGE DeriveGeneric, LambdaCase, TypeApplications, StandaloneDeriving, RankNTypes #-} {-# LANGUAGE QuasiQuotes, ViewPatterns, OverloadedStrings #-} module Test.Test where import Prelude hiding (GT) import Control.Applicative import Control.Monad import Control.Monad.Extra (loopM) import Control.Monad.Logic imp...
andorp/grin
grin/src/Test/Test.hs
bsd-3-clause
27,835
0
29
7,261
10,252
5,332
4,920
674
10
every :: Int -> [a] -> [a] every n xs = case drop (n-1) xs of (y:ys) -> y : every n ys [] -> [] isLeapYear :: Integral a => a -> Bool isLeapYear year = if mod year 100 == 0 then mod year 400 == 0 else mod year 4 == 0 days :: (Num a1, Num t, Integral a, Eq a1) => a1 -> a -> t days month y...
JacksonGariety/euler.hs
019.hs
bsd-3-clause
936
0
10
246
508
264
244
19
2
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Quantity.KO.Rules ( rules ) where i...
facebookincubator/duckling
Duckling/Quantity/KO/Rules.hs
bsd-3-clause
2,695
0
18
689
702
374
328
62
12
import Data.Time import Data.Time.Clock.AnnouncedLeapSeconds import Test.QuickCheck onceCheck :: Bool -> IO () onceCheck = quickCheckWith (stdArgs {maxSuccess = 1}) -- A few trivial tests. main :: IO () main = do onceCheck $ lst (fromGregorian 1111 12 31) == Just 0 -- Before first leap second. onceCheck $ lst (...
bjornbm/leapseconds-announced
tests/Test.hs
bsd-3-clause
888
0
11
179
341
162
179
17
1
-- ----------------------------------------------------------------------------- -- Copyright 2002, Simon Marlow. -- Copyright 2006, Bjorn Bringert. -- Copyright 2009, Henning Thielemann. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted prov...
xpika/mohws
src/Network/MoHWS/Logger/Error.hs
bsd-3-clause
4,323
0
13
990
933
511
422
76
2
{-# LANGUAGE TypeOperators #-} -- | -- Module : Data.OI.Resource -- Copyright : (c) Nobuo Yamashita 2011-2016 -- License : BSD3 -- Author : Nobuo Yamashita -- Maintainer : nobsun@sampou.org -- Stability : experimental -- module Data.OI.Resource ( -- * Resource type Resource(..) -- * File res...
nobsun/oi
src/Data/OI/Resource.hs
bsd-3-clause
5,331
0
18
1,577
2,432
1,242
1,190
127
4
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.ARB.VertexArrayObject -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portab...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/VertexArrayObject.hs
bsd-3-clause
823
0
4
97
58
46
12
8
0
module Main where import Prelude () import ClassyPrelude import Arguments import System.FilePath (FilePath) import Distribution.Package import Distribution.PackageDescription import Distribution.PackageDescription.Parse (readPackageDescription) import Distribution.Version (Version(..)) import Distribution.Verbosity (v...
RobertFischer/cabalish
src/Main.hs
bsd-3-clause
1,205
0
11
201
351
182
169
31
2
module Control.Proxy.Conduit (module Data.PipesConduit) where import Data.PipesConduit
DanBurton/pipes-conduit
Control/Proxy/Conduit.hs
bsd-3-clause
87
0
5
7
20
13
7
2
0
{-# LANGUAGE TypeFamilies #-} -- | Richmen computation for SSC. module Pos.DB.Lrc.Consumer.Ssc ( -- * The 'RichmenComponent' instance sscRichmenComponent -- * The consumer , sscLrcConsumer -- * Functions for getting richmen , getSscRichmen , tryGetSscRichmen...
input-output-hk/pos-haskell-prototype
db/src/Pos/DB/Lrc/Consumer/Ssc.hs
mit
2,641
0
10
541
361
215
146
41
1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RecordWildCards, UndecidableInstances #-} module PersistentTest ( module PersistentTest , cleanDB , testMigrate , noPrefixMigrate , customPrefixMigrate , treeMigrate ) where import Control.Monad.Fail import Control.Monad.IO.Class import Dat...
paul-rouse/persistent
persistent-test/src/PersistentTest.hs
mit
21,871
27
74
6,577
8,200
3,884
4,316
522
1
{-# OPTIONS_GHC -fno-warn-orphans #-} module Application ( getApplicationDev , appMain , develMain , makeFoundation -- * for DevelMain , getApplicationRepl , shutdownApp -- * for GHCI , handler , db ) where import Control.Monad.Logger (liftLoc, runLoggingT) i...
MaxGabriel/hackvote-yesod
Application.hs
cc0-1.0
6,719
0
16
1,723
1,029
551
478
-1
-1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE LambdaCase #-} import System.Environment (getArgs) import qualified Data.Map as M import qualified Data.Set as S import...
abau/co4
test/CO4/Thesis/LoopBenchmark.hs
gpl-3.0
7,080
0
16
2,140
2,365
1,201
1,164
135
5
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/CreateKeyPair.hs
mpl-2.0
5,048
0
11
1,162
637
388
249
75
1
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} module CmmExpr ( CmmExpr(..), cmmExprType, cmmExprWidth, maybeInvertCmmExpr , CmmReg(..), cmmRegType , CmmLit(..), cmmLitType , LocalReg...
snoyberg/ghc
compiler/cmm/CmmExpr.hs
bsd-3-clause
21,973
0
12
5,883
4,561
2,369
2,192
343
2
module Propellor.Ssh where import Propellor import Utility.SafeCommand import Utility.UserInfo import System.PosixCompat import Data.Time.Clock.POSIX -- Parameters can be passed to both ssh and scp, to enable a ssh connection -- caching socket. -- -- If the socket already exists, check if its mtime is older than 10 ...
avengerpenguin/propellor
src/Propellor/Ssh.hs
bsd-2-clause
1,243
15
16
250
298
150
148
29
2
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} -------------------------------------------------------------------------------- -- | -- Module ...
spacekitteh/compdata
src/Data/Comp/Multi/Sum.hs
bsd-3-clause
3,385
0
13
741
749
415
334
52
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 #-} -------------------...
getyourguide/fbthrift
thrift/compiler/test/fixtures/namespace/gen-hs/My/Namespacing/Test/HsTestService_Fuzzer.hs
apache-2.0
4,716
0
12
797
1,299
784
515
90
2
{-# OPTIONS_GHC -cpp #-} {-# LANGUAGE DeriveDataTypeable #-} module HsAssocStruct where import Data.Generics -- Formerly known as InfixAssoc... data HsFixity = HsFixity HsAssoc Int deriving (Ord,Eq,Show,Read, Data, Typeable) data HsAssoc = HsAssocNone | HsAssocLeft | HsAssocRight deriving (Ord, Eq...
kmate/HaRe
old/tools/base/AST/HsAssocStruct.hs
bsd-3-clause
350
0
6
65
90
51
39
10
0
module Data.Store.Guid.Arbitrary () where import Data.Store.Guid (Guid) import Test.QuickCheck (Arbitrary(..)) instance Arbitrary Guid where arbitrary = fmap Guid arbitrary
schell/lamdu
bottlelib/Data/Store/Guid/Arbitrary.hs
gpl-3.0
177
0
6
23
54
33
21
5
0
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude, BangPatterns, MagicHash #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Bits -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICE...
beni55/haste-compiler
libraries/ghc-7.10/base/Data/Bits.hs
bsd-3-clause
21,707
0
14
6,336
3,685
2,049
1,636
256
2
{-# LANGUAGE CApiFFI #-} module T4012_B where import Foreign.C b :: IO () b = withCString "Int: %d\n" $ \fstr -> printfb fstr 9 foreign import capi "stdio.h printf" printfb :: CString -> CInt -> IO ()
sdiehl/ghc
testsuite/tests/ffi/should_run/T4012_B.hs
bsd-3-clause
206
0
9
42
67
36
31
6
1
module Main (main) where import Data.String (fromString) import Data.Word (Word32) import Data.Maybe (fromJust) import Control.Applicative import Control.Monad import Control.Monad.Trans (liftIO) import Control.Error (readMay, runMaybeT, MaybeT(..), hoistMaybe) import Data.Base58Address (RippleAddress) import Text.Ema...
singpolyma/ripple-notify
Main.hs
isc
5,553
177
17
996
2,015
1,086
929
125
2
module Luhn ( addends , checkDigit , checksum , create , isValid ) where addends :: Integral a => a -> [a] addends n = reverse (zipWith f [1 ..] (stigid n)) where f i x | odd i = x | x >= 5 = 2 * x - 9 | otherwise = 2 * x stigid :: Integral a => a -> [a] stigid 0 = [] stigid n = r : stigid q where (...
tfausak/exercism-solutions
haskell/luhn/Luhn.hs
mit
646
0
10
185
341
183
158
26
1
{-# LANGUAGE CPP #-} module GHCJS.DOM.WebGLShaderPrecisionFormat ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.WebGLShaderPrecisionFormat #else #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) im...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/WebGLShaderPrecisionFormat.hs
mit
391
0
5
33
33
26
7
4
0
----------------------------------------------------------------------------- -- Copyright : (c) Hanzhong Xu, Meng Meng 2016, -- License : MIT License -- -- Maintainer : hanzh.xu@gmail.com -- Stability : experimental -- Portability : portable ---------------------------------------------------------------...
PseudoPower/AFSM
examples/SM/RPN.hs
mit
3,966
2
15
988
1,394
760
634
73
5
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} -- | -- This is the beginnings of the standard library. module Technique.Builtins where import Core.Data.Structures import Core.Text.Rope () import Technique.Internal import Technique.Language -- Do these need descriptions? Not really, unless this becom...
oprdyn/technique
lib/Technique/Builtins.hs
mit
2,853
0
11
672
519
294
225
67
1
{- Copyright (C) 2012 Christopher Walker <http://gsd.uwaterloo.ca> 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, m...
gsdlab/clafer
src/Language/Clafer/Generator/Graph.hs
mit
22,900
0
21
5,634
6,477
3,286
3,191
319
15
{-# LANGUAGE FlexibleInstances #-} module Control.Attribute ( Attribute(..) ) where import Control.Applicative ( (<$>), (<*>) ) import Control.Unit ( Unit, block ) import Data.String.Utils import Text.Fragment import Text.ParserCombinators.Parsec import Text.ParserCombinators.TagWiki import Text.Printf import Text.Rend...
Soares/tagwiki
src/Control/Attribute.hs
mit
899
0
11
185
275
155
120
23
0
-- módulo pilha module TPilha (TPilha, push, pop, top, size, empty, isEmpty) where data TPilha p = Pilha [p] deriving (Eq, Ord, Show) -- constrói uma pilha vazia empty :: TPilha p empty = (Pilha []) -- verifica se a pilha está vazia isEmpty :: TPilha p->Bool isEmpty (Pilha []) = True isEmpty (Pilh...
thiagopnobre/avaliador_expressoes
TPilha.hs
mit
775
0
9
191
293
155
138
18
1
{-# LANGUAGE Safe #-} module SMTLib1 ( Name(..) , Ident(..) , Quant(..) , Conn(..) , Formula(..) , Sort , Binder(..) , Term(..) , Literal(..) , Annot(..) , FunDecl(..) , PredDecl(..) , Status(..) , Command(..) , Script(..) , (===) , (=/=) , (.<.) , (.>.) , tInt , funDef , co...
yav/smtLib
src/SMTLib1.hs
mit
418
0
5
122
163
116
47
30
0
-- :l C:\Local\Dev\haskell\learn_chapter8.hs -- === Algebraic data types === -- C:\Local\Dev\haskell\Shape.hs import Shape import qualified Data.Map as Map import Data.List c1 = Circle (Point 1 1) 10 c2 = Circle (Point 2 3) 3 r1 = Rectangle (Point 0 0) (Point 2 2) r2 = Rectangle (Point 1 1) (Point 11 21) shapes = [...
feliposz/learning-stuff
haskell/learn_chapter8.hs
mit
9,795
19
17
2,520
2,580
1,406
1,174
147
3
{-# LANGUAGE NoImplicitPrelude #-} module Main where import BasePrelude main = return ()
jhenahan/adventofcode
src/Main.hs
mit
91
0
6
15
18
11
7
4
1
module Philed.Data.Forest (Forest(..), Tree(..), Cursor ,unzipper, view ,top, left, right, up, down, siblings, cousins, level ,filterC, descendents) where import Data.List (tails) import Control.Monad newtype Forest a = Forest { unforest ::...
Chattered/PhilEdCommon
Philed/Data/Forest.hs
mit
2,467
0
15
857
1,278
676
602
57
2
{-# LANGUAGE RecursiveDo #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE ScopedTypeVariables #-} import Data.Aeson import Data.Maybe import GHC.Generics (Generic) import Reflex import Reflex.Dom data Person = Person { name :: String , age :: Int , favoriteFood :: String } deriving (Show, Generic) instance Fr...
paldepind/reflex-examples
fetch-json-list/Fetch.hs
mit
1,037
6
14
194
319
158
161
28
1
module BinaryTrees where import Data.List import Text.Parsec.String import Text.Parsec hiding (Empty) data Tree a = Empty | Branch a (Tree a) (Tree a) deriving (Show, Eq) leaf :: a -> Tree a leaf x = Branch x Empty Empty {- - 3 Problem 55 - (**) Construct completely balanced binary trees - - In...
yyotti/99Haskell
src/main/BinaryTrees.hs
mit
21,490
0
16
6,783
3,013
1,533
1,480
146
4
module My.Data ( Entry(..) , EntryVer , EntryKey , EntryIV , FileId , latestVer , entryToFileStat ) where import qualified Data.ByteString as B import qualified Data.Text as T import Data.Binary import Data.Word import Network.Google.Drive import Control.Monad import System.Fuse import System.Posix.Typ...
CindyLinz/GCryptDrive
src/My/Data.hs
mit
1,537
0
9
321
325
206
119
-1
-1
{-| Module : Language.X86.Hardware Description : Datatypes specific to the hardware of the x86 Copyright : (c) Jacob Errington and Frederic Lafrance, 2016 License : MIT Maintainer : goto@mail.jerrington.me Stability : experimental The mirror image of "Language.X86.Virtual", except with hardware registers....
djeik/goto
libgoto/Language/X86/Hardware.hs
mit
4,860
0
12
1,054
647
393
254
96
1
module Sat where import Control.Applicative import Control.Monad import Control.Monad.Random import Control.Monad.Supply import Data.List import Data.Set (Set) import qualified Data.Set as Set import Data.Maybe import Debug.Trace type Sat = [Clause] type Clause = [Lit] type Lit = Int -- https://en.wikipedia.org/wiki/...
JLiangWaterloo/sat
Haskell/Sat.hs
mit
6,372
0
18
1,914
2,532
1,341
1,191
160
4
module Main ( main ) where -- doctest import qualified Test.DocTest as DocTest main :: IO () main = DocTest.doctest [ "-isrc" , "src/Calc.hs" ]
mauriciofierrom/cis194-homework
homework05/test/examples/Main.hs
mit
167
0
6
48
44
27
17
8
1
{-# LANGUAGE OverloadedStrings #-} module InTheKnow.Routes.Home.Templates ( index ) where import Prelude hiding (span) import Web.Scotty.Blaze (blaze) import Text.Blaze.Html5 import qualified Text.Blaze.Html5.Attributes as A index = a ! A.href "http://google.com" $ "index"
jb55/intheknow
InTheKnow/Routes/Home/Templates.hs
mit
280
0
8
38
68
44
24
8
1
-- | a cellular automata witch is inspired by neurons in our brain module Brain (Neuron(..), brainRule, main) where import CellularAutomata2D import GUI -- | simulate Brians Brain main :: IO () main = randomSpace (50, 50) [Ready, Firing, Refractory] >>= runCellularAutomata2D brainRule >> return () -- | the state of ...
orion-42/cellular-automata-2d
Brain.hs
mit
1,057
0
14
243
250
136
114
18
3