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 : Graphics.Rendering.OpenGL.Raw.OES -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- -- A conveni...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/OES.hs
bsd-3-clause
1,216
0
5
110
138
111
27
13
0
{-# LANGUAGE DeriveDataTypeable, RecordWildCards #-} module Haystack.Game where import Control.Monad (liftM2) import Data.Foldable (foldlM) import Data.Typeable import Safe import Utils (pmap) import CSV (CSV, OfGames, OfPrefs, asInt, asBool, asString, rows, column, toCSV) import Haystack.Types d...
isovector/haystack
src/Haystack/Game.hs
bsd-3-clause
5,247
0
16
2,849
1,019
565
454
116
2
{-# LANGUAGE OverloadedStrings #-} module Data.Aeson.JsonPointerSpec (spec) where import Test.Hspec import Data.Aeson (decode, Value(..)) import Data.Aeson.JsonPointer spec :: Spec spec = do describe "descent" $ do it "object in object" $ getValue (tloc >>= descend "/root/bar") `shouldBe` Bool...
llhotka/tiphys
test/Data/Aeson/JsonPointerSpec.hs
bsd-3-clause
858
0
16
227
236
120
116
20
1
import Language.Clojure.Parser import Language.Clojure.PrettyPrint import System.FilePath.Find import System.Directory main :: IO () main = do cljFiles <- find always (extension ==? ".clj") "./test/repos" mapM_ testFile cljFiles parseClj :: String -> Expr parseClj f = case parse parseTop "test" f of Left err ->...
nazrhom/vcs-clojure
test/Spec.hs
bsd-3-clause
954
0
21
234
351
168
183
26
4
module XDFNetwork where import Types type XML = String xmlFromProgramConnections :: CalProject -> [String] -> Int -> Int -> Int -> XML -- xml actors conns = unlines $ xmlFromProgramConnections (CalProject actors connections) unusedActors fifoDepth {- outBitWidth -} inputColour outputColour = unlines $ [ "<?xml v...
robstewart57/ripl
src/XDFNetwork.hs
bsd-3-clause
7,598
0
14
1,673
1,772
946
826
158
3
{-# LANGUAGE RankNTypes #-} module Llvm.Matcher where import qualified Llvm.Asm.Data as A import qualified Llvm.Hir.Data as I import qualified Llvm.AsmHirConversion as Cv import qualified Compiler.Hoopl as H import qualified Data.Map as M import Llvm.AsmHirConversion import Llvm.Hir.Target.Linux_Gnu import Llvm.Hir.Ta...
mlite/hLLVM
src/Llvm/Matcher.hs
bsd-3-clause
3,240
0
20
1,096
912
476
436
51
5
{-# LANGUAGE Safe #-} {-# LANGUAGE Arrows #-} module Control.Arrow.Machine.Evolution ( switchAfter, dSwitchAfter, kSwitchAfter, dkSwitchAfter, gSwitchAfter, dgSwitchAfter, finishWith, evolve ) where import Prelude hiding (id, (.)) import ...
as-capabl/machinecell
src/Control/Arrow/Machine/Evolution.hs
bsd-3-clause
1,998
0
11
543
732
380
352
71
1
module Network.EasyBitcoin.Internal.ByteString where import Data.Binary import qualified Data.ByteString as BS import qualified Data.ByteString.Base16 as B16 import qualified Data.ByteString.Char8 as C ( pack, unpack) import Control.Monad (guard,(<=<)) import Control.Applicative import Data.List (unfoldr) import Data...
vwwv/easy-bitcoin
Network/EasyBitcoin/Internal/ByteString.hs
bsd-3-clause
4,475
0
14
1,340
1,212
649
563
82
2
module BowlingGame.Kata (score) where import Data.List (genericIndex) score :: [Int] -> Int score = score' 0 1 where score' :: Int -> Int -> [Int] -> Int score' currentScore frameIndex rolls | frameIndex == 11 = currentScore | isStrike ...
Alex-Diez/haskell-tdd-kata
BowlingGameKata/BowlingGameDay01/src/BowlingGame/Kata.hs
bsd-3-clause
1,269
0
13
559
321
166
155
23
1
{------------------------------------------------------------------------------- MorphGrammar.Hofm.Language.German.Inflection HOFM German word formation rules (c) 2012 Britta Zeller <zeller@cl.uni-heidelberg.de> Jan Snajder <jan.snajder@fer.hr> -------------------------------------------------------------------...
jsnajder/hofm
src/MorphGrammar/Hofm/Language/German/Inflection.hs
bsd-3-clause
1,463
0
8
120
201
124
77
15
1
module SubListKata.Day7Spec (spec) where import Test.Hspec import SubListKata.Day7 (sublist, Result(..)) spec :: Spec spec = do it "emtpy equals empty" $ do sublist "" "" `shouldBe` Equal it "empty is sublist of anything" $ do sublist "" "anyhting" `shouldBe` S...
Alex-Diez/haskell-tdd-kata
old-katas/test/SubListKata/Day7Spec.hs
bsd-3-clause
796
0
11
267
211
104
107
19
1
module Main where import World import Graphics.Gloss import Graphics.Gloss.Interface.Pure.Game pVel :: Float pVel = 310.0 -- paddle velocity window :: Display window = InWindow "Gloss Pong" (800, 600) (10, 10) main :: IO () main = play window black 60 ge...
jamiltron/GlossPong
Main.hs
bsd-3-clause
1,085
0
9
313
388
200
188
27
1
-------------------------------------------------------------------------------- module LoremMarkdownum.Token.Parse ( streamsFromDir , wordFrequencyTreePerLength ) where -------------------------------------------------------------------------------- import Data.Char (isAlpha...
jaspervdj/lorem-markdownum
lib/LoremMarkdownum/Token/Parse.hs
bsd-3-clause
2,762
0
20
807
609
327
282
48
10
{- The palindromic number 595 is interesting because it can be written as the sum of consecutive squares: 6^2 + 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2. There are exactly eleven palindromes below one-thousand that can be written as consecutive square sums, and the sum of these palindromes is 4164. Note that 1 = 0^2 + 1^...
bgwines/project-euler
src/solved/problem125.hs
bsd-3-clause
2,147
10
12
370
532
298
234
43
2
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeSynonymInstances #-} module Strategies where import Control.Monad import Data.List import Data.Random import Data.Random.List import E...
mattrrichard/darwin
src/Strategies.hs
bsd-3-clause
1,919
0
13
412
412
211
201
34
2
{-# LANGUAGE TemplateHaskell #-} module IOChoiceTHSpec where import Control.Exception import Control.Exception.IOChoice import Control.Exception.IOChoice.TH import System.IO.Error import Test.Hspec (||>>) :: IO a -> IO a -> IO a (||>>) = $(newIOChoice [''ErrorCall, ''ArithException]) spec :: Spec spec = describe "|...
kazu-yamamoto/io-choice
test/IOChoiceTHSpec.hs
bsd-3-clause
1,091
0
13
228
314
163
151
32
1
module Web.Zenfolio.Collections ( collectionAddPhoto, collectionRemovePhoto ) where import Web.Zenfolio.Monad (ZM) import Web.Zenfolio.RPC (zfRemote) import Web.Zenfolio.Types (Void, PhotoID, PhotoSetID) collectionAddPhoto :: PhotoSetID -> PhotoID -> ZM Void collectionAddPhoto = zfRemote "CollectionAddPhoto" ...
md5/hs-zenfolio
Web/Zenfolio/Collections.hs
bsd-3-clause
436
0
7
53
102
59
43
10
1
module System.Mesos.Raw.TrafficControlStatistics where import System.Mesos.Internal type TrafficControlStatisticsPtr = Ptr TrafficControlStatistics foreign import ccall unsafe "ext/types.h toTrafficControlStatistics" c_toTrafficControlStatistics :: Ptr CChar -- ^ id -> CInt -- ^ idlen -> Ptr CULong --...
Atidot/hs-mesos
src/System/Mesos/Raw/TrafficControlStatistics.hs
mit
4,207
0
28
1,086
951
450
501
112
0
-- | Re-exports of Pos.Communication.* module Pos.Communication ( module M ) where import Pos.Communication.Limits as M import Pos.Communication.Server as M import Pos.Communication.Types as M import Pos.Infra.Communication.BiP as M import Pos.Infra.Comm...
input-output-hk/pos-haskell-prototype
lib/src/Pos/Communication.hs
mit
503
0
4
140
82
62
20
10
0
-- -- -- ----------------- -- Exercise 6.34. ----------------- -- -- -- module E'6'34 where import B'C'6 ( Image ) import E'6''8 ( rotate90 ) import Pictures ( Picture , flipH , flipV , height , width ) gFlipH :: Image -> Image -- flips to the top gFlipH ([] , position) = ([] , position) gFlipH ( ...
pascal-knodel/haskell-craft
_/links/E'6'34.hs
mit
1,583
0
10
359
488
289
199
50
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} module HERMIT.Dictionary.Inline ( -- * Inlining externals , InlineConfig(..) , CaseBinderInlineOption(..) , getUnfoldingT , getUnfoldingsT , ensureBoundT , inlineR , inlineNameR ...
conal/hermit
src/HERMIT/Dictionary/Inline.hs
bsd-2-clause
12,405
0
27
3,872
2,409
1,250
1,159
152
13
{-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE GADTs #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.IndexUtils -- Copyright : (c) Duncan Coutts 2008 -- License : BSD-like -- -- Maintai...
tolysz/prepare-ghcjs
spec-lts8/cabal/cabal-install/Distribution/Client/IndexUtils.hs
bsd-3-clause
26,795
0
22
6,549
5,593
2,926
2,667
435
11
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[HsLit]{Abstract syntax: source-language literals} -} {-# LANGUAGE CPP, DeriveDataTypeable #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUA...
bitemyapp/ghc
compiler/hsSyn/HsLit.hs
bsd-3-clause
7,980
0
12
2,205
1,695
880
815
112
1
module Hi.FilePath ( rewritePath ) where import Hi.Template (untemplate) import Data.List import Data.List.Split (splitOn) import System.FilePath (joinPath, splitPath) -- | Convert given path to the destination path, with given options. rewritePath :: String ...
jonathankochems/hi
src/Hi/FilePath.hs
bsd-3-clause
1,435
0
10
297
314
173
141
23
2
module Main where import Quickpull import Decrees main :: IO () main = defaultMain decrees
massysett/quickpull
tests/quickpull-tests.hs
bsd-3-clause
93
0
6
17
28
16
12
5
1
module Robots3.TH where import Robots3.Data import Robots3.Config import Inter.Types () -- get some default instances import Data.List ( isPrefixOf ) import Control.Monad ( guard ) -- $(asXmlRpcStruct ''Position) -- $(asXmlRpcStruct ''Robot) -- $(asXmlRpcStruct ''Zug) {- instance XmlRpcType Config where getTy...
florianpilz/autotool
src/Robots3/TH.hs
gpl-2.0
603
0
5
127
49
32
17
6
0
{-# LANGUAGE OverloadedStrings, FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Documentation.Haddock.ParserSpec (main, spec) where import Data.String import qualified Documentation.Haddock.Parser as Parse import Documentation.Haddock.Types import Documentation.Haddock...
Fuuzetsu/haddock
haddock-library/test/Documentation/Haddock/ParserSpec.hs
bsd-2-clause
33,751
0
27
11,669
6,566
3,207
3,359
732
2
{-# LANGUAGE GADTs #-} -- Trac #2520: a bug in the specialiser when we tried to -- quantify over an Internal Name module Types where data Prod a b = Prod a b data Nil = Nil class ProdSel f where nil :: f Nil prod :: f x -> f y -> f (Prod x y) instance ProdSel SqlFields where nil = SFNil prod = SFProd ...
ghc-android/ghc
testsuite/tests/simplCore/should_compile/T2520.hs
bsd-3-clause
618
0
11
146
199
103
96
17
1
{-# OPTIONS -cpp #-} -- !!! Testing IEEE Float and Double extremity predicates. module Main(main) where import Data.Char import Control.Monad.ST import Data.Word import Data.Array.Unsafe ( castSTUArray ) import Data.Array.ST #include "ghcconfig.h" reverse_if_bigendian :: [a] -> [a] #ifdef WORDS_BIGENDIAN reverse_if_...
urbanslug/ghc
testsuite/tests/codeGen/should_run/cgrun044.hs
bsd-3-clause
5,181
0
14
1,513
1,460
787
673
146
1
----------------------------------------------------------------------------- -- | -- Module : Main -- Copyright : (C) 2015 Braden Walters -- 2015 Ricky Elrod -- License : MIT (see LICENSE file) -- Maintainer : Braden Walters <vc@braden-walters.info> -- Ricky Elrod <ricky@elr...
meoblast001/ext2-info
src/Main.hs
mit
794
0
17
177
141
77
64
14
3
module Compile where import System.Exit (ExitCode(ExitSuccess, ExitFailure)) import System.Process (readProcessWithExitCode) data CommandError = MissingExe String | CommandFailed String String missingExe :: String -> CommandError missingExe command = MissingExe $ "Could not find command `" ++ command...
paramanders/elm-watcher
src/Compile.hs
mit
1,384
0
15
423
376
192
184
34
4
-- | Tests related to the base types that support the nix cache. module Nix.Cache.Types.Tests where import ClassyPrelude hiding (ByteString) import Test.QuickCheck (Arbitrary(..), oneof, property, elements) import Data.ByteString.Lazy (ByteString) import Data.Either (isLeft) import Test.Hspec (Spec, describe, it, shou...
adnelson/nix-binary-cache
tests/Nix/Cache/Types/Tests.hs
mit
2,227
0
19
587
567
300
267
54
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-} module Numeric.QuadraticIrrational.Ring ( QuadExt(..) ) where import Data.Proxy import Numeric.QuadraticIrrational.SquareFree data QuadExt (c :: SquareFree) t = Quad...
ion1/quadratic-irrational
src/Numeric/QuadraticIrrational/Ring.hs
mit
1,612
0
14
433
701
353
348
34
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {- Definitions for document and exercise pages -} module Codex.Page where import Text.Pandoc hiding (Code) import qualified Text.Pandoc ( Inline(Code) ) import Text.Pandoc.Walk -- import ...
pbv/codex
src/Codex/Page.hs
mit
6,650
0
13
1,540
2,119
1,091
1,028
157
2
{-# LANGUAGE LambdaCase, OverloadedStrings #-} module Chapter7.Syntax where import Control.Applicative import Data.Monoid import qualified Data.Text.Lazy.Builder as LB import Data.Display import Chapter7.Identifier import Chapter7.Exception data Term = TmFree Name | TmVar Int Int -- TmVar { index :: Int, de...
VoQn/tapl-hs
src/Chapter7/Syntax.hs
mit
3,607
0
14
795
1,211
630
581
89
4
{-| Module: Y2015.D18 Description: Advent of Code Day 18 Solutions. License: MIT Maintainer: @tylerjl Solutions to the day 18 set of problems for <adventofcode.com>. -} {-# LANGUAGE QuasiQuotes #-} module Y2015.D18 (animateLights, animateStuckLights) where import Data.Array.Repa ((:...
tylerjl/adventofcode
src/Y2015/D18.hs
mit
2,638
0
13
868
771
420
351
48
2
{-# LANGUAGE FlexibleContexts, UndecidableInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Database.Persist.Zookeeper.Store ( delete...
greydot/persistent
persistent-zookeeper/Database/Persist/Zookeeper/Store.hs
mit
4,254
0
22
1,156
1,337
673
664
108
1
insertionSort :: Ord a => [a] -> [a] insertionSort [] = [] insertionSort (x:xs) = insert x (insertionSort xs) where insert x [] = [x] insert x (y:ys) | x <= y = x:y:ys | otherwise = y:insert x ys
RAFIRAF/HASKELL
Sorting Algorithms/insertionSort2.hs
mit
207
0
10
51
131
65
66
7
2
{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE NoImplicitPrelude #-} module System.Etc.Internal.Resolver.Env (resolveEnv, resolveEnvPure) where import RIO import qualified RIO.HashMap as HashMap import qualified RIO.Set as Set import qualified RIO.Text as Text import Sy...
roman/Haskell-etc
etc/src/System/Etc/Internal/Resolver/Env.hs
mit
3,349
0
23
833
649
335
314
64
2
-- Copyright (c) Microsoft. All rights reserved. -- Licensed under the MIT license. See LICENSE file in the project root for full license information. import Test.Tasty import Test.Tasty.QuickCheck import Test.Tasty.HUnit (testCase) import Tests.Syntax import Tests.Codegen import Tests.Codegen.Util(utilTestGroup) tes...
sapek/bond
compiler/tests/TestMain.hs
mit
8,055
0
14
3,097
1,052
539
513
162
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.html module Stratosphere.ResourceProperties.LambdaFunctionEnvironment where impo...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/LambdaFunctionEnvironment.hs
mit
1,418
0
12
155
161
94
67
22
1
{-# LANGUAGE FlexibleContexts #-} module BN.Common( module Control.Monad , module Control.Applicative , module Control.Monad.State , module Control.Monad.Except , module Control.Monad.Identity , BError , split , (><) , (-|-) , M(..) , Err , panic , err , errLoc , assert , assertM , a...
VictorCMiraldo/hs-bn
BN/Common.hs
gpl-2.0
1,686
0
8
352
510
286
224
-1
-1
module Tema_14c_PilaPropiedades_Spec (main, spec) where import Tema_14.PilaPropiedades import Test.Hspec import Test.QuickCheck main :: IO () main = hspec spec spec :: Spec spec = do describe "Tema_14c" $ do it "p1" $ property prop_cima_apila it "p2" $ property prop_desapila_apila it "p3" $...
jaalonso/I1M-Cod-Temas
test/Tema_14c_PilaPropiedades_Spec.hs
gpl-2.0
410
0
11
94
117
56
61
17
1
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-} -- Improved Bash parser for Aura, built with Parsec. {- Copyright 2012, 2013, 2014 Colin Woodbury <colingw@gmail.com> This file is part of Aura. Aura is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publishe...
vigoos/Farrago-OS
aura-master/aura-master/src/Bash/Parser.hs
gpl-2.0
7,248
0
13
1,673
1,883
989
894
111
3
module HEP.Automation.MadGraph.Dataset.Set20110308set1 where import HEP.Automation.MadGraph.Model import HEP.Automation.MadGraph.Machine import HEP.Automation.MadGraph.UserCut import HEP.Automation.MadGraph.Cluster import HEP.Automation.MadGraph.SetupType import HEP.Automation.MadGraph.Dataset.Common my_ssetup :: S...
wavewave/madgraph-auto-dataset
src/HEP/Automation/MadGraph/Dataset/Set20110308set1.hs
gpl-3.0
1,712
0
10
425
356
219
137
47
1
{-# LANGUAGE DeriveGeneric, OverloadedStrings #-} module Kraken.Result.AddOrder ( AddOrder(..) ) where import Kraken.Result import Data.Text import Data.Aeson import GHC.Generics data Descr = Descr { order :: String , close :: Maybe String } deriving (Show, Generic) data AddOrder = AddOrd...
laugh-at-me/kraken-api
src/Kraken/Result/AddOrder.hs
gpl-3.0
489
0
10
99
134
77
57
17
0
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE TypeOperators , FlexibleContexts , BangPatterns #-} module Main where import Control.Monad import Control.Concurrent.MVar import Control.Concurrent (forkIO) import qualified Data.Array.Repa as R import Data.Array.Repa (Z(..), (:.)(..)) import D...
peddie/gol
src/Main.hs
gpl-3.0
4,444
0
15
1,577
1,340
689
651
88
2
module Lambda ( id', t', f', fst', snd', k', apply', twice', thrice', comp', -- self' -- y' ) where newtype Rec a = In { out :: Rec a -> a } id' = \x -> x t' = \x y -> x f' = \x y -> y fst' = \x -> (\y -> x) snd' = \x -> (\y -> y) k' = fst' apply' = \f -> (\x -> f x) twice' = \f -> (\x -> f (f x)) thrice' =...
adarqui/lambda-calculus
Lambda.hs
gpl-3.0
608
0
12
172
302
179
123
23
1
{- ============================================================================ | Copyright 2011 Matthew D. Steele <mdsteele@alum.mit.edu> | | | | This file is part of Fallback. | ...
mdsteele/fallback
src/Fallback/Test/QuadTree.hs
gpl-3.0
2,978
0
17
995
661
356
305
28
1
{-# LANGUAGE Arrows #-} module Env where import FRP.Yampa import CLTypes testster :: SF () (Amp, Amp) testster = constant 0.5 >>> (identity &&& identity) mono2stereo :: SF (Amp) (Amp,Amp) mono2stereo = identity &&& identity
jchbenjamin/CLSound
env.hs
gpl-3.0
231
2
7
42
80
46
34
8
1
module Zoepis.ZKeys where import Data.Bits newtype KeyVector = KV Integer zAKey, zSKey, zDKey, zWKey :: Int zAKey = 0 zSKey = 1 zDKey = 2 zWKey = 3 zSetKey :: KeyVector -> Int -> KeyVector zSetKey (KV k) i = KV $ k .|. bit i zClearKey :: KeyVector -> Int -> KeyVector zClearKey (KV k) i = KV $ k .&. complemen...
abakst/Zoepis
Zoepis/ZKeys.hs
gpl-3.0
394
0
8
90
166
91
75
14
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-deploymentmanager/gen/Network/Google/Resource/DeploymentManager/Resources/List.hs
mpl-2.0
8,733
0
25
2,110
1,157
678
479
159
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MagicHash #-} module Word128 where import Data.Bits import Data.Data (Data, Typeable) import Data.Word (Word32 (..), Word64 (..), byteSwap32, byteSwap64) {-# ...
shapr/schrabble
src/Word128.hs
agpl-3.0
4,382
0
13
1,620
1,147
615
532
62
1
{- Generare la lista potenzialmente infinita dei numeri di Fibonacci usando le funzioni zip e tail (e l’assioma di comprensione). Scrivere poi una funzione che restituisce i primi n nmeri di Fibnacci che soddisfano un certo predicato p. Fare gli esempio con i predicati di primalita’ (trovare i primi n numer...
0iras0r/ld2016
2016/static/learning/unito/materiale_terminale/esercizio.hs
agpl-3.0
5,348
0
13
1,169
1,493
799
694
56
1
{- ORMOLU_DISABLE -} -- Implicit CAD. Copyright (C) 2011, Christopher Olah (chris@colah.ca) -- Copyright (C) 2014 2015 2016, Julia Longtin (julial@turinglace.com) -- Released under the GNU AGPLV3+, see LICENSE {- The purpose of this file is to pass on the functionality we want to be accessible to an end user who is...
colah/ImplicitCAD
Graphics/Implicit.hs
agpl-3.0
6,028
0
9
1,352
904
567
337
140
1
module Flatten where data Node a = Child a | Parent (Node a) a (Node a) deriving (Show, Eq) data Tree a = Empty | Root (Node a) deriving (Show, Eq) invert :: Tree a -> Tree a invert Empty = Empty invert (Root n) = Root (aux n) where aux (Child a) = Child a aux (Parent l n r) = Parent (aux r) n (aux l) -- s...
ice1000/OI-codes
codewars/1-100/flatten-a-tree.hs
agpl-3.0
613
0
9
182
362
184
178
18
2
{-# LANGUAGE ScopedTypeVariables, OverloadedStrings #-} {-# LANGUAGE CPP #-} #if MIN_VERSION_base(4,9,0) {-# LANGUAGE OverloadedLabels #-} #endif #if !MIN_VERSION_base(4,9,0) {-# LANGUAGE PatternSynonyms #-} #endif {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} import Prelude hiding (error, (++), putStrLn, show) import q...
ford-prefect/haskell-gi
test/testGtk.hs
lgpl-2.1
19,526
0
23
5,274
4,307
2,074
2,233
-1
-1
import Debug.Trace pascal = [1] : ( map (\row -> zipWith (+) (row++[0]) (0:row) ) pascal ) scnt n = n * (n+1) `div` 2 p_count2 rows divby = length $ filter ((/=0).(`mod` divby)) $concat $ take rows pascal p_count rows divby = let total = scnt rows inper = scnt $ divby - 1 tris = (r...
jdavidberger/project-euler
prob148.hs
lgpl-3.0
645
1
13
194
300
165
135
16
1
ans' [] _ _ = "YES" ans' (i:is) (a:as) (b:bs) | (i>a) && (a>b) = ans' is (i:a:as) (b:bs) | (a>i) && (i>b) = ans' is (a:as) (i:b:bs) | (a>b) && (b>i) = "NO" | otherwise = ans' (i:is) (b:bs) (a:as) ans i = ans' i [0] [-1] -- a /= b main = do n <- getLine c <- getContents let n' = read n :: Int -- ...
a143753/AOJ
0033.hs
apache-2.0
471
0
15
136
334
170
164
14
1
import System.Random import Data.List.Split checkingThings :: Int -> Int -> [[Int]] -> Int checkingThings i j world = let isAlive = world!!i!!j == 1 in if isAlive then (if sumNeighbours i j world == 2 || sumNeighbours i j world == 3 then 1 else 0) else (if sumNe...
SimonRichards/HaskellOfLife
HaskellTimes.hs
apache-2.0
1,271
0
15
421
607
321
286
34
5
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} module Kubernetes.V1.NodeList where import Network.HTTP.Types import Network.HTTP.Conduit import Data.Aeson import System.IO.Streams() import GHC.Generics (Generic) import Kubernetes.V1.Metadata import Kubernetes.V1.Node as Node {- v1.NodeList { kind...
satnam6502/haskell-kubernetes
Kubernetes/V1/NodeList.hs
apache-2.0
5,943
0
13
888
191
108
83
23
2
{-# LANGUAGE PackageImports #-} import "NeatlineUpdate" Application (getApplicationDev) import Network.Wai.Handler.Warp (runSettings, defaultSettings, settingsPort) import Control.Concurrent (forkIO) import System.Directory (doesFileExist, removeFile) import System.Exit (exitSuccess) import Control.Concurrent (thre...
erochest/NeatlineUpdate
devel.hs
bsd-2-clause
708
0
10
123
186
101
85
23
2
-- | -- Module : Crypto.PubKey.RSA.PSS -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : Good -- module Crypto.PubKey.RSA.PSS ( PSSParams(..) , defaultPSSParams , defaultPSSParamsSHA1 -- * Sign and verify functions , s...
vincenthz/hs-crypto-pubkey
Crypto/PubKey/RSA/PSS.hs
bsd-2-clause
5,703
0
12
1,888
1,317
719
598
102
2
-- 1587000 import Data.Ratio((%)) nn = 99 % 100 digitCmp0 _ _ 0 = True digitCmp0 f p n = if f m p then False else digitCmp0 f m d where m = n `mod` 10 d = n `div` 10 digitCmp f n = digitCmp0 f (n `mod` 10) (n `div` 10) genBouncyRatio0 n s | isBouncy n = (s+1) % n : genBouncyRatio0 (n+1) (s+1) |...
higgsd/euler
hs/112.hs
bsd-2-clause
577
0
10
145
296
157
139
14
2
module Prop.Fluid ( fluidProps ) where import Test.QuickCheck import Codec.Goat.Fluid import Codec.Goat.ValueFrame -- | All tests assert the correct functionality of the Fluid type. fluidProps :: [(String, Property)] fluidProps = [ ("fluidAppendShiftDump", property fluidAppendShiftDump) ] -- | Append each inner lis...
lovasko/goat
test/Prop/Fluid.hs
bsd-2-clause
1,000
0
12
237
217
123
94
16
2
-- | Kernel verification. module RISK.Verify ( verifyKernel ) where import Data.List (nub) import Data.Maybe (fromJust) import Language.GIGL import MonadLib import System.IO import Text.Printf --import RISK.Config import RISK.Kernel import RISK.Spec -- | Verifies properties of the kernel. verifyKernel :: Spec ->...
tomahawkins/risk
RISK/Verify.hs
bsd-2-clause
4,804
0
17
1,147
1,377
682
695
103
7
-- This is the hash function for content addressing. module Database.VCache.Hash ( hashVal ) where import Data.Hashable import qualified Data.ByteString.Internal as BSI import Foreign.ForeignPtr import Database.LMDB.Raw (MDB_val(..)) hashVal :: MDB_val -> IO Int hashVal mv = do fp <- newForeignPt...
dmbarbour/haskell-vcache
hsrc_lib/Database/VCache/Hash.hs
bsd-2-clause
427
0
14
88
124
68
56
12
1
{-# LANGUAGE ExistentialQuantification, TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Implementation of the opcodes. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provi...
apyrgio/snf-ganeti
src/Ganeti/OpCodes.hs
bsd-2-clause
28,633
0
12
7,438
5,711
3,507
2,204
922
2
module Paths_plugins_auto ( version, getBinDir, getLibDir, getDataDir, getLibexecDir, getDataFileName, getSysconfDir ) where import qualified Control.Exception as Exception import Data.Version (Version(..)) import System.Environment (getEnv) import Prelude catchIO :: IO a -> (Exception.IOException -> IO...
sheganinans/plugins-auto
dist/dist-sandbox-f086e21e/build/autogen/Paths_plugins_auto.hs
bsd-3-clause
1,526
0
10
177
359
204
155
28
1
{-# LANGUAGE OverloadedStrings #-} module Client.CLPred where import Control.Lens (use, preuse, ix, (^.), (.=), (%=)) import Control.Monad (liftM, unless, when) import Data.Bits ((.&.), shiftR, (.|.)) import Linear (V3(..), _x, _y, _z) import Game.CVarT import Game.PMoveT import Game.EntityStateT import Game.TraceT i...
ksaveljev/hake-2
src/Client/CLPred.hs
bsd-3-clause
10,793
1
36
3,634
2,789
1,425
1,364
-1
-1
{-# LANGUAGE CPP #-} -- | Extra functions for the current system info. module System.Info.Extra( module System.Info, isWindows, isMac, ) where import System.Info --------------------------------------------------------------------- -- System.Info -- | Return 'True' on Windows and 'False' otherwise. ...
ndmitchell/extra
src/System/Info/Extra.hs
bsd-3-clause
873
0
5
149
64
47
17
10
1
module Test where import Obsidian.MonadObsidian import Prelude hiding (sum) import Obsidian.MonadObsidian.IC import qualified Data.Set as Set import qualified Data.Map as Map import Control.Monad.State kernel :: Syncable (GArr b) => (SArr a -> GPU (SArr b)) -> GArr a -> GPU (GArr b) kernel k = cache ->...
svenssonjoel/MonadObsidian
Obsidian/MonadObsidian/Test.hs
bsd-3-clause
1,780
0
14
483
673
340
333
-1
-1
module LiftToToplevel.LiftInLambda where foo :: IO () foo = do let xx = map (\b -> (b,(uses everythingStaged)declaredPns [b])) [] return () where declaredPns = undefined everythingStaged = undefined uses everythingStaged pns t2= concat $ everythingStaged (++) []
mpickering/HaRe
test/testdata/LiftToToplevel/LiftInLambda.expected.hs
bsd-3-clause
288
0
16
63
110
58
52
9
1
{-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- | This module exists just to expose an orphan instance of Show for Requests. -- It would obviously fit better in the module the type is defined in, but -- pending future code motion, meh. ... -- module Network.HTTP.Types.UglyOrphanInstance () whe...
pqwy/google-web-apis
Network/HTTP/Types/UglyOrphanInstance.hs
bsd-3-clause
1,664
0
18
462
610
326
284
35
1
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-} module Math.Vector ( Vector(..) , vertex2Tuple , vector2Tuple , vertex3Tuple , vector3Tuple , vertex4Tuple , color4Tuple , insideRect , insideTriangle , intersect , sameSide , slope , angleBetween ) where import Graphics.Rendering.OpenGL...
rakete/ObjViewer
src/Math/Vector.hs
bsd-3-clause
10,343
0
18
2,818
6,213
3,247
2,966
222
4
module Haskelltter ( l , lc , lu , m , u , re , del , rt , us , allfav , setup ) where import Control.Monad.IO.Class (liftIO) import Data.Conduit import Data.Monoid import Data.Int import qualified Data.Text as T import qualified Data.Text.IO as T import System.Directory...
amutake/haskelltter
src/Haskelltter.hs
bsd-3-clause
3,895
0
19
977
1,501
712
789
137
5
-- (c) The University of Glasgow 2006 {-# LANGUAGE CPP #-} -- The default iteration limit is a bit too low for the definitions -- in this module. {-# OPTIONS_GHC -fmax-pmcheck-iterations=10000000 #-} module OptCoercion ( optCoercion, checkAxInstCo ) where #include "HsVersions.h" import GhcPrelude import DynFlags ...
ezyang/ghc
compiler/types/OptCoercion.hs
bsd-3-clause
34,532
0
19
8,780
8,040
4,052
3,988
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} module Check where import Build_ghc_server_tests import Control.Applicative import Control.Monad import Control.Monad.IO.Class import Data.List import Data.Monoid import qualified Data.Text as T import ...
bennofs/ghc-server
tests/Check.hs
bsd-3-clause
6,139
0
23
1,412
1,797
938
859
117
2
{-# LANGUAGE DeriveDataTypeable #-} module ConfigParser where import Text.JSON import Text.JSON.Generic import qualified Data.Map as M data Pattern = Pattern { pattern :: String, textToSend :: String, nextDispatcher :: String, timeout :: Int } deriving (Eq, Show, Data, Typeable) data Di...
vasylp/serialtalk
src/ConfigParser.hs
bsd-3-clause
1,194
0
12
307
361
203
158
33
1
module LeapYearKata.Day10Spec (spec) where import Test.Hspec import LeapYearKata.Day10 (isLeapYear) spec :: Spec spec = do it "is a leap year when divisible by 4" $ do isLeapYear 1996 `shouldBe` True it "is not a leap year when not divisible by 4" $ do isLeapYe...
Alex-Diez/haskell-tdd-kata
old-katas/test/LeapYearKata/Day10Spec.hs
bsd-3-clause
550
0
11
179
124
62
62
13
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} -- | Description: Configuration for the system. module Retcon.Configuration where import Control.Applicative impo...
anchor/retcon
lib/Retcon/Configuration.hs
bsd-3-clause
7,044
0
17
1,917
1,739
900
839
149
3
----------------------------------------------------------------------------- -- | -- Module : TestSuite.Basics.ArithNoSolver -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Test suite for basic concrete arithmetic, i.e., testing al...
Copilot-Language/sbv-for-copilot
SBVUnitTest/TestSuite/Basics/ArithNoSolver.hs
bsd-3-clause
23,870
0
38
8,283
12,272
6,600
5,672
295
3
{-# LANGUAGE DataKinds #-} {-| Utility functions relevant to typechecking. -} module Language.K3.TypeSystem.Monad.Utils ( freshTypecheckingQVar , freshTypecheckingUVar , envRequire , envRequireM , aEnvRequireAnn , pEnvRequire ) where import Control.Applicative import Data.Map (Map) import qualified Data.Map as Map...
DaMSL/K3
src/Language/K3/TypeSystem/Monad/Utils.hs
apache-2.0
2,031
0
11
372
536
287
249
37
2
module Tests.Language.Interpreter.If ( interpreterIfTests ) where import Test.Framework ( Test , testGroup ) import Test.Framework.Providers.HUnit ( testCase ) import Test.H...
rumblesan/improviz
test/Tests/Language/Interpreter/If.hs
bsd-3-clause
2,158
0
13
540
366
196
170
45
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeSynonymInstances #-} -------------------------------------------------------------------------------- -- | -- Module : Data.Comp.Arbitrary -- Cop...
spacekitteh/compdata
src/Data/Comp/Arbitrary.hs
bsd-3-clause
2,465
0
11
496
592
325
267
35
0
{-# LANGUAGE DeriveDataTypeable, TemplateHaskell #-} module Data.StringTable {-( StringTable, lookup, index, construct, prop, )-} where import Prelude hiding (lookup) import qualified Data.List as List import qualified Data.Array.Unboxed as A import Data.Array.Unboxed ((!)) import Data.S...
isomorphism/hackage2
Data/StringTable.hs
bsd-3-clause
2,915
0
13
732
980
515
465
61
3
{-| Module : Idris.Core.TT Description : The core language of Idris, TT. Copyright : License : BSD3 Maintainer : The Idris Community. TT is the core language of Idris. The language has: * Full dependent types * A hierarchy of universes, with cumulativity: Type : Type1, Type1 : Type2, ... * Patt...
tpsinnem/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
72,602
0
20
22,813
26,752
13,558
13,194
-1
-1
module Main where import ClassyPrelude import Control.Lens ((&)) import Untyped.Parser hiding (main) import Untyped.CST import Untyped.Hoon import Untyped.Core import Nock import SimpleNoun import Dashboard import Text.Show.Pretty (pPrint) import qualified Prelude as P --------------------------------------------...
ngzax/urbit
pkg/hs/proto/app/Main.hs
mit
891
0
14
218
281
139
142
-1
-1
{-| Incident handling in the maintenance daemon. This module implements the submission of actions for ongoing repair events reported by the node-status data collector. -} {- Copyright (C) 2015 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are perm...
leshchevds/ganeti
src/Ganeti/MaintD/HandleIncidents.hs
bsd-2-clause
14,285
0
22
4,676
2,964
1,549
1,415
236
6
------------------------------------------------------------------------------- -- -- | Main API for compiling plain Haskell source code. -- -- This module implements compilation of a Haskell source. It is -- /not/ concerned with preprocessing of source files; this is handled -- in "DriverPipeline". -- -- There are var...
abakst/liquidhaskell
src/Language/Haskell/Liquid/Desugar710/HscMain.hs
bsd-3-clause
2,973
0
10
517
502
276
226
43
2
<?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="fil-PH"> <title>TreeTools</title> <maps> <homeID>treetools</homeID> <mapref location="m...
kingthorin/zap-extensions
addOns/treetools/src/main/javahelp/help_fil_PH/helpset_fil_PH.hs
apache-2.0
961
77
66
155
404
205
199
-1
-1
module Test9 where f x = x + (let x = 56; y = 67 in (let x = 56 in x + y))
SAdams601/HaRe
old/testing/refacSlicing/Test9.hs
bsd-3-clause
91
0
13
40
54
29
25
3
1
module RecordIn1 where data S = S1 { x :: Int } | S2 { x :: Int } deriving Show {- map2 xs = map (\y -> S1 {x = 1}) xs -} map2 xs = (case ((\ y -> S1 {x = 1}), xs) of (f, []) -> [] (f, (x : xs)) -> (f x) : (map2 xs))
kmate/HaRe
old/testing/generativeFold/RecordIn1_TokOut.hs
bsd-3-clause
250
0
11
94
122
72
50
5
2
{-# LANGUAGE ScopedTypeVariables #-} -- Trac #2714 module T2714 where f :: ((a -> b) -> b) -> (forall c. c -> a) f = ffmap ffmap :: Functor f => (p->q) -> f p -> f q ffmap = error "urk" {- a ~ f q c ~ f p (p->q) ~ (a->b) -> b => a ~ f q c ~ f p p ~ a->b q ~ b => a ...
hvr/jhc
regress/tests/1_typecheck/4_fail/ghc/T2714.hs
mit
346
0
9
140
88
49
39
6
1
module Eratosthenes where -- Part of Cosmos by OpenGenus Foundation eratosthenes :: [Integer] -- A list of all prime numbers eratosthenes = go [2..] where -- If we have something in the front of the list (x:xs), -- we know it wasn't filtered, so it's prime. -- Then, we filter the rest of the list to exc...
OpenGenus/cosmos
code/mathematical_algorithms/src/sieve_of_eratosthenes/sieve_of_eratosthenes.hs
gpl-3.0
505
0
14
125
118
67
51
8
1
-- Use Template Haskell to generate good instances. {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Twitter.TH ( Metadata(..) , Geo(..) , Story(..) , Result(..) ) where import Data.Aeson.TH import Twitter $(deriveJSON defaultOptions ''Metadata) $(deriveJSON de...
lykahb/aeson
examples/Twitter/TH.hs
bsd-3-clause
415
0
8
74
104
58
46
14
0
-- | Support for command-line completion at the REPL and in the prover module Idris.Completion (replCompletion, proverCompletion) where import Idris.Core.Evaluate (ctxtAlist) import Idris.Core.TT import Idris.AbsSyntax (runIO) import Idris.AbsSyntaxTree import Idris.Help import Idris.Imports (installedPackages) impor...
stevejb71/Idris-dev
src/Idris/Completion.hs
bsd-3-clause
8,721
0
16
2,642
2,347
1,234
1,113
139
16
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-} -- Trac #1795 module ShouldCompile where data A a = A class MkA a b | a -> b where mkA :: a -> A b instance MkA a a where translate :: (String, a) -> A a translate a = mkA a
ryantm/ghc
testsuite/tests/typecheck/should_compile/FD3.hs
bsd-3-clause
280
0
8
73
82
45
37
8
1
{-# OPTIONS_GHC -fwarn-unused-imports #-} module T9061 where import Prelude hiding (log) f = log where log = ()
siddhanathan/ghc
testsuite/tests/module/T9061.hs
bsd-3-clause
114
0
7
20
28
18
10
4
1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE ScopedTypeVariables #-} module PostgREST.Middleware where import Data.Aeson (Value (..)) import qualified Data.HashMap.Strict as M import Data.String.Conversions (cs) import Data.Text import qualified H...
league/postgrest
src/PostgREST/Middleware.hs
mit
2,195
0
14
663
504
282
222
43
2