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 OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ssekmsencryptedobjects.html module Stratosphere.ResourceProperties.S3BucketSseKmsEncryptedObjects w...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/S3BucketSseKmsEncryptedObjects.hs
mit
1,541
0
13
164
174
100
74
23
1
{-# LANGUAGE CPP #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE OverloadedStrings #-} #ifndef NO_OVERLAP {-# LANGUAGE OverlappingInstances #-} #endif module Data...
junjihashimoto/persistent
persistent/Database/Persist/Class/PersistField.hs
mit
15,253
0
15
3,432
4,449
2,267
2,182
263
3
{-# LANGUAGE OverloadedStrings #-} module Compiler ( renderKaTeX , renderFontAwesome , optimizeSVGCompiler , absolutizeUrls , prependBaseUrl , cleanIndexHtmls , modifyExternalLinkAttributes ) where import Control.Monad import Data.Char import qualified Data.HashMap.Strict as HM ...
Tosainu/blog
src/Compiler.hs
mit
4,376
0
16
1,065
1,474
752
722
92
6
{-# Language OverloadedStrings #-} import Control.Arrow ((&&&), first, (>>>)) import System.Environment (getArgs) import qualified Data.List as L import qualified Data.Text as T import qualified Data.Text.IO as T main :: IO () main = getArgs >>= run run :: [String] -> IO () run [] = ex...
sordina/tabulate
tabulate.hs
mit
1,691
0
15
671
516
272
244
43
1
-- | -- Module : Graphics.WaveFront.Model -- Description : -- Copyright : (c) Jonatan H Sundqvist, 2016 -- License : MIT -- Maintainer : Jonatan H Sundqvist -- Stability : stable -- Portability : portable -- -- TODO | - Single-pass (eg. consume all tokens only once) for additional performance (?) -- ...
SwiftsNamesake/3DWaves
src/Graphics/WaveFront/Model.hs
mit
15,133
0
15
3,276
3,511
1,887
1,624
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} module Course.FastAnagrams where import Course.Core import Course.List import Course.Functor import qualified Data.Set as S -- Return all anagrams of the given string -- that appear in the given dictionary file. fastAnagrams :: Chars -> File...
harrisi/on-being-better
list-expansion/Haskell/course/src/Course/FastAnagrams.hs
cc0-1.0
610
0
9
108
123
74
49
-1
-1
{-# LANGUAGE OverloadedStrings #-} -------------------------------------------------------------------------------- import Hakyll -------------------------------------------------------------------------------- main :: IO () main = hakyll $ do match "css/*" $ compile compressCssCompiler match ("js/*" .||. "im...
abeidler/abeidler.github.io
Site.hs
gpl-2.0
1,164
0
14
237
224
106
118
21
1
{-| Base common functionality. This module holds common functionality shared across Ganeti daemons, HTools and any other programs. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License a...
damoxc/ganeti
src/Ganeti/Common.hs
gpl-2.0
13,664
0
18
4,144
2,690
1,453
1,237
245
6
module Handler.Schule where import Import import Autolib.Multilingual spracheMsg :: Language -> AutotoolMessage spracheMsg sprache' = case sprache' of DE -> MsgSpracheDE NL -> MsgSpracheNL UK -> MsgSpracheUK spracheOptionen :: Handler (OptionList Language) spracheOptionen = optionsPairs $ map (\s -> (spracheMs...
marcellussiegburg/autotool
yesod/Handler/Schule.hs
gpl-2.0
1,393
0
13
238
431
215
216
32
3
import qualified SimpleArithmeticTest as Arith import qualified IdempotenceTest as Idem import Test.QuickCheck main :: IO () main = do quickCheck Arith.prop_halfIdentity quickCheck Arith.prop_stringListOrdered quickCheck Arith.plusAssociative quickCheck Arith.plusCommutative quickCheck Arith.produc...
nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles
Testing/quickcheck-testing/test/Main.hs
gpl-3.0
786
0
8
128
177
75
102
23
1
-- Propositional logic module PropLogicLib ( Form(F, T, Var, Neg, Conj, Disj, Imp, Equiv), showForm, readsForm, pf, Theorem(), projHyps, projForm, taut, disch, mp, andIntro, andElimL, andElimR, orIntroL, orIntroR, orElim, notIntro, notElim, trueIntro, falseElim ) where { imp...
ckaestne/CIDE
CIDE_Language_Haskell/test/fromviral/PropLogicLib.hs
gpl-3.0
10,238
16
19
3,865
3,003
1,649
1,354
-1
-1
module MaFRP.Netwire.Test where import Control.Wire import Prelude hiding ((.) , id ) wire :: (Monad m, HasTime t s) => Wire s () m a t wire = time main :: IO () main = testWire clockSession_ wire
KenetJervet/mapensee
haskell/frp/Netwire/Test.hs
gpl-3.0
221
0
7
62
86
49
37
9
1
module L0229 where data Maybe1 a = Just1 a | Nothing1 deriving Show instance Functor Maybe1 where fmap f Nothing1 = Nothing1 fmap f (Just1 a) = Just1 (f a) instance Applicative Maybe1 where pure = Just1 (<*>) Nothing1 _ = Nothing1 (<*>) _ Nothing1 = Nothing1 (<*>) (Just1 a) (Just1 b) = Just1 (a b) instance ...
cwlmyjm/haskell
AFP/L0229.hs
mpl-2.0
1,557
0
12
503
722
376
346
46
3
-- This Source Code Form is subject to the terms of the Mozilla Public -- License, v. 2.0. If a copy of the MPL was not distributed with this -- file, You can obtain one at http://mozilla.org/MPL/2.0/. {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE OverloadedStrings #-} module Data.Redis.Resp ( Resp (..) , r...
twittner/redis-resp
src/Data/Redis/Resp.hs
mpl-2.0
2,938
0
14
760
817
428
389
84
7
-- brittany { lconfig_indentAmount: 4, lconfig_indentPolicy: IndentPolicyMultiple } foo = do let aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa foo
lspitzner/brittany
data/Test355.hs
agpl-3.0
218
0
10
38
23
11
12
4
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module Core.ModelSpec where import Core.Database ((=:)) import Core.Model import qualified Data.Map.Strict as M import Data.Text (Text) import qualified GHC.Generics as GN import qualified Misc.Json as...
inq/agitpunkt
spec/Core/ModelSpec.hs
agpl-3.0
1,853
0
15
538
516
289
227
51
1
-- | -- Module: SwiftNav.SBP -- Copyright: Copyright (C) 2015 Swift Navigation, Inc. -- License: LGPL-3 -- Maintainer: Mark Fine <dev@swiftnav.com> -- Stability: experimental -- Portability: portable module SwiftNav.SBP where import BasicPrelude import Data.Binary import Data.Binary.Get import Data.Bina...
paparazzi/libsbp
generator/sbpg/targets/resources/SbpTemplate.hs
lgpl-3.0
1,443
6
10
316
496
277
219
-1
-1
{-# LANGUAGE QuasiQuotes #-} module Sqlcmds where import Str(str) -- ----------------------------------------------------------------------------------------------------- -- ---------------------------------------------------------------------------------------------------- stuff = [str| SELECT NULL AS TABLE_CAT,...
sourcewave/pg-schema-diff
Sqlcmds.hs
unlicense
1,882
0
5
419
24
18
6
4
1
-- -- Emmental.hs -- Interpreter for the Emmental Programming Language -- Chris Pressey, Cat's Eye Technologies -- This work is in the public domain. See UNLICENSE for more information. -- module Language.Emmental where import Prelude ( Show, Char, IO, putStr, getChar, putChar, last, init, (++), (+), (-), (*...
catseye/Emmental
src/Language/Emmental.hs
unlicense
12,572
2
21
3,553
2,813
1,550
1,263
200
1
data Tree a = Empty | Node a (Tree a) (Tree a) deriving (Show) -- Example tree number 1 tree1 :: Tree Int tree1 = Node 1 (Node 2 (Node 3 Empty Empty) (Node 4 Empty Empty) ) (Node 5 (Node 6 Empty Empty) (Node 7 Empty Empty) ) -- Example tree number 2 tree2 :: Tree Int tr...
gnclmorais/interview-prep
recursion/04april/05treesSum.hs
unlicense
1,554
0
12
438
608
310
298
41
1
t2s m s d = m * 60 + s + d / 100.0 ans (t1:t2:_) | (t1 < (t2s 0 35 50)) && (t2 < (t2s 1 11 00)) = "AAA" | (t1 < (t2s 0 37 50)) && (t2 < (t2s 1 17 00)) = "AA" | (t1 < (t2s 0 40 00)) && (t2 < (t2s 1 23 00)) = "A" | (t1 < (t2s 0 43 00)) && (t2 < (t2s 1 29 00)) = "B" | (t1 < (t2s 0 50 00)) && (t2 < (t2s 1 45 00)...
a143753/AOJ
0123.hs
apache-2.0
588
0
14
190
454
228
226
15
1
ans (m:f:b:_) = if m >= b then "0" else if (m+f) >= b then show (b-m) else "NA" main = do l <- getLine let i = map read $ words l :: [Int] o = ans i putStrLn o
a143753/AOJ
0358.hs
apache-2.0
200
0
11
81
116
59
57
11
3
-- 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/cabal2bazel
bzl/tests/recursive/Regular.hs
apache-2.0
677
0
6
119
35
27
8
3
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} module Main where import Data.Default import Data.Int (Int64) import Data.Text (Text) import qualified API import qualified Data.Text as Text import qualified Data.Text.Lazy as ZText im...
Sapiens-OpenSource/webbench
haskell/docs/src/Main.hs
bsd-2-clause
2,667
0
16
733
577
297
280
66
1
{-# LANGUAGE QuasiQuotes #-} module Cauterize.JavaScript.TestClientTemplate ( testClientFromSpec ) where import Data.String.Interpolate import Data.Text.Lazy (unpack) import qualified Cauterize.Specification as S testClientFromSpec :: S.Spec -> String testClientFromSpec spec = let ln = unpack $ S.specName spec...
cauterize-tools/caut-javascript-ref
src/Cauterize/JavaScript/TestClientTemplate.hs
bsd-3-clause
896
0
11
140
81
49
32
10
1
module Import ( module Import ) where import Prelude as Import hiding (head, init, last, readFile, tail, writeFile) import Yesod as Import hiding (Route (..)) import Control.Applicative as Import (pure,...
Tener/deeplearning-thesis
yesod/abaloney/Import.hs
bsd-3-clause
1,066
0
6
506
149
108
41
17
1
{-# LANGUAGE FlexibleInstances , MultiParamTypeClasses , TemplateHaskell , TypeFamilies , TypeOperators , ViewPatterns #-} module Examples.ForceLayout where import Graphics.UI.Toy.Prelude import Prelude hiding ((.)) import Control.Category ((.)) import Data....
mgsloan/toy-gtk-diagrams
Examples/ForceLayout.hs
bsd-3-clause
3,162
0
16
916
1,087
570
517
75
1
{-# LANGUAGE RecordWildCards #-} module Network.CommSec.KeyExchange.Socket ( Network.CommSec.KeyExchange.Socket.connect , Network.CommSec.KeyExchange.Socket.accept , Net.listen, Net.bind, Net.socket , CS.send , CS.recv , CS.Connection , CS.close ) where import Control.Concurrent.MVar im...
TomMD/commsec-keyexchange
Network/CommSec/KeyExchange/Socket.hs
bsd-3-clause
1,588
0
12
308
450
247
203
41
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} module Mistral.CodeGen.LambdaLift ( lambdaLift ) where import Mistral.Driver import Mistral.ModuleSystem.Export ( Export(..) ) import Mistral.TypeCheck.AST import Mistral.TypeCheck.Unify import Mistral.Utils.Names import Mistral....
GaloisInc/mistral
src/Mistral/CodeGen/LambdaLift.hs
bsd-3-clause
12,480
0
23
3,637
3,958
1,988
1,970
228
16
module Options.Warnings where import Types warningsOptions :: [Flag] warningsOptions = [ flag { flagName = "-W" , flagDescription = "enable normal warnings" , flagType = DynamicFlag , flagReverse = "-w" } , flag { flagName = "-w" , flagDescription = "disable all warnin...
gridaphobe/ghc
utils/mkUserGuidePart/Options/Warnings.hs
bsd-3-clause
16,097
0
12
4,970
1,898
1,212
686
319
1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-| Module : Game.GoreAndAsh.GLFW.Module Description : Monad transformer of the module Copyright : (c) Anton Gushcha, 2015-2016 License : BSD3 Maintainer : ncrashed@gmail.com Stability : experimental Portability : POSIX The module contains declaration of monad transf...
Teaspot-Studio/gore-and-ash-glfw
src/Game/GoreAndAsh/GLFW/Module.hs
bsd-3-clause
7,332
0
16
1,693
2,070
1,067
1,003
-1
-1
{-# OPTIONS_GHC -fno-warn-unused-imports #-} module Data.API.Tutorial ( -- * Introduction -- $introduction -- * The api DSL -- $api -- ** Generating types for an API -- $generate -- * Generating tools for an API -- $tools -- * Data migration -- $migration -- ** Custom mi...
adinapoli/api-tools
src/Data/API/Tutorial.hs
bsd-3-clause
8,102
0
4
1,579
93
70
23
12
0
{-# LANGUAGE TemplateHaskell #-} module Schedooler.Internal where import Control.Concurrent import Control.Concurrent.STM import Control.Monad import Data.PSQueue import Data.Time data Task = Task { name :: String , action :: IO () , frequency :: String } instance Eq Task where ...
darthdeus/schedooler
src/Schedooler/Internal.hs
bsd-3-clause
1,971
0
15
629
761
369
392
60
2
module Game ( freshPuzzle , runGame ) where import Control.Monad (forever, when) import Data.Maybe (isJust, fromMaybe) import Data.List (intersperse) import System.Exit (exitSuccess) data Puzzle = Puzzle String [Maybe Char] [Char] instance Show Puzzle where show (Puzzle _ hits guessed) = i...
NewMountain/hangmanSimple
src/Game.hs
bsd-3-clause
2,715
0
14
873
768
383
385
73
3
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-...
benweitzman/servant-named
src/Servant/API/Named.hs
bsd-3-clause
1,962
0
12
459
687
396
291
49
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Crypto.Multihash import Data.ByteString (ByteString) import qualified Data.ByteString as B import Data.List import System.Console.GetOpt import System.IO hiding (withFile) import System.Environment import System.Exit import Text.Printf (printf) main :: IO (...
mseri/crypto-multihash
app/Main.hs
bsd-3-clause
2,032
0
15
490
747
374
373
57
4
-- 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 RecordWildCards #-} {-# LANGUAGE NoRebindableSyntax #-} module Duckling.Types.Stash where import q...
facebookincubator/duckling
Duckling/Types/Stash.hs
bsd-3-clause
2,057
0
12
355
619
333
286
37
4
{-# LANGUAGE DeriveDataTypeable #-} module Control.Pipe.Attoparsec ( ParseError(..), pipeParser, ) where import qualified Control.Exception as E import Control.Pipe import Control.Pipe.Combinators import Control.Pipe.Exception import Data.Attoparsec.Types import Data.Maybe import Data.Monoid import Data.Typeable...
pcapriotti/pipes-attoparsec
Control/Pipe/Attoparsec.hs
bsd-3-clause
1,412
0
15
373
316
175
141
32
4
{-# LANGUAGE OverloadedStrings #-} module CacheDNS.APP.Types ( ServerConfig(..) , DNSKey(..) , DNSServer(..) , GlobalConfig(..) ) where import qualified CacheDNS.DNS as DNS data ServerConfig = ServerConfig { server_host :: Maybe String , server_port :: Maybe String...
DavidAlphaFox/CacheDNS
app/CacheDNS/APP/Types.hs
bsd-3-clause
1,006
0
10
468
207
126
81
22
0
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANG...
cchalmers/shaped
src/Data/Dense/Base.hs
bsd-3-clause
21,760
3
28
5,715
6,469
3,346
3,123
391
2
module Foreign.CRCSpec (main, spec) where import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do describe "someFunction" $ do it "should work fine" $ do True `shouldBe` False
smurphy8/crc-fast
test/Foreign/CRCSpec.hs
bsd-3-clause
208
0
13
49
76
40
36
9
1
import qualified Language.Structure.Dependency as Dep (drawTree) import qualified Language.Structure.Dependency.Parse as Dep (pTree,pDeps) import Text.ParserCombinators.UU.Utils (runParser) main :: IO () main = putStrLn . Dep.drawTree . runParser "stdin" Dep.pDeps =<< getContents
pepijnkokke/Dep2Con
src/PrintDep.hs
bsd-3-clause
314
0
8
63
81
49
32
9
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} module DigitalOcean.Droplet( Droplet(..), droplets ) where import Control.Applicative () import Control.Monad (liftM, mzero) import Control.Monad.IO.Class import Data.Aeson ((.:), FromJSON(..), Value(..), decode) import Dig...
satokazuma/digitalocean-kzs
src/DigitalOcean/Droplet.hs
mit
1,682
0
16
397
464
269
195
43
2
module Java.Annotations ( getAnnotations, parseModifier ) where import Language.Java.Syntax import Java.Helper (concatIdent) getAnnotations :: CompilationUnit -> [String] getAnnotations (CompilationUnit _ _ typeDecls) = concatMap fromTypeDecls typeDecls ++ concatMap methods typeDecls fromTypeDecls :: TypeDec...
SmallImprovements/spring-clean
src/Java/Annotations.hs
mit
1,235
0
9
186
439
225
214
32
1
module Helper ( module Test.Hspec , module Test.QuickCheck , module Control.Applicative , module Data.IORef ) where import Test.Hspec import Test.QuickCheck import Control.Applicative import Data.IORef
hspec/hspec
hspec-contrib/test/Helper.hs
mit
245
0
5
67
50
32
18
9
0
{-# LANGUAGE PatternGuards, CPP, ScopedTypeVariables, ViewPatterns, FlexibleContexts #-} {- Copyright (C) 2010-2015 John MacFarlane <jgm@berkeley.edu> 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; ...
alexvong1995/pandoc
src/Text/Pandoc/Writers/EPUB.hs
gpl-2.0
53,512
0
27
19,306
14,685
8,001
6,684
1,078
38
{-# OPTIONS -O2 -Wall #-} {-# LANGUAGE TemplateHaskell, GeneralizedNewtypeDeriving #-} module Data.Store.Rev.Version (VersionData, depth, parent, changes, Version, versionIRef, versionData, makeInitialVersion, newVersion, mostRecentAncestor, walkUp, walkDown, versionsBetween) where import ...
alonho/bottle
src/Data/Store/Rev/Version.hs
gpl-3.0
3,821
0
15
814
1,078
552
526
72
5
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Network.AWS.ElasticBeanstalk.Types.Su...
fmapfmapfmap/amazonka
amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/Types/Sum.hs
mpl-2.0
11,167
0
12
2,619
2,211
1,111
1,100
287
0
{-# OPTIONS_GHC -fno-warn-orphans #-} -- | @SPECIALIZE@ pragma declarations for RGBA images. module Vision.Image.RGBA.Specialize () where import Data.Int import Vision.Histogram (Histogram, histogram, histogram2D) import Vision.Image.RGBA.Type (RGBA) import Vision.Image.Transform ( InterpolMethod, crop, resize...
RaphaelJ/friday
src/Vision/Image/RGBA/Specialize.hs
lgpl-3.0
1,069
0
5
284
94
64
30
18
0
-- | -- DNA is a data flow DSL aimed at expressing data movement and initiation of -- computational kernels for numerical calculations. We use the "actor/channel" -- paradigm, which allows for a descriptive approach that separates definition -- from execution strategy. Our target is data intensive high performance comp...
SKA-ScienceDataProcessor/RC
MS5/dna/core/DNA.hs
apache-2.0
13,704
0
5
3,153
506
427
79
59
0
-- | Delay a thread for n seconds or minutes. module Control.Concurrent.Delay (delaySeconds ,delayMinutes) where import Control.Concurrent -- | Delay the current thread for at least n seconds. delaySeconds :: Integer -> IO () delaySeconds 0 = return () delaySeconds n = do threadDelay (1000 * 1000); delaySecond...
yuvallanger/threepenny-gui
src/Control/Concurrent/Delay.hs
bsd-3-clause
452
0
9
81
112
61
51
9
1
{-# LANGUAGE OverloadedStrings #-} module Stack.Types.TemplateNameSpec where import Stack.Types.TemplateName import Path.Internal import System.Info (os) import Test.Hspec spec :: Spec spec = describe "TemplateName" $ do describe "parseTemplateNameFromString" $ do let pathOf s = either error templatePath...
juhp/stack
src/test/Stack/Types/TemplateNameSpec.hs
bsd-3-clause
2,635
0
23
695
579
281
298
39
2
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn...
jasonzoladz/persistent
persistent-template/Database/Persist/TH.hs
mit
59,086
0
23
17,395
14,828
7,779
7,049
-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="id-ID"> <title>AMF Support</title> <maps> <homeID>amf</homeID> <mapref location="map.jh...
thc202/zap-extensions
addOns/amf/src/main/javahelp/help_id_ID/helpset_id_ID.hs
apache-2.0
956
77
66
156
407
206
201
-1
-1
{-# LANGUAGE CPP #-} module Pkg.Package where import System.Process import System.Directory import System.Exit import System.IO import System.FilePath ((</>), addTrailingPathSeparator, takeFileName, takeDirectory, normalise) import System.Directory (createDirectoryIfMissing, copyFile) import Util.System import Contr...
osa1/Idris-dev
src/Pkg/Package.hs
bsd-3-clause
11,857
0
24
4,586
3,140
1,498
1,642
232
4
{-# LANGUAGE GADTs, TypeFamilies #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Machine.Is -- Copyright : (C) 2012 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : prov...
fumieval/machines
src/Data/Machine/Is.hs
bsd-3-clause
1,192
0
12
249
296
168
128
28
0
module B1 (myFringe) where import D1 () import D1 hiding (sumSquares, fringe) import D1 (fringe) import C1 hiding (myFringe) myFringe :: (Tree a) -> [a] myFringe (Leaf x) = [x] myFringe (Branch left right) = myFringe right sumSquares ((x : xs)) = (x ^ 2) + (sumSquares xs) sumSquares [] = 0
kmate/HaRe
old/testing/mkImpExplicit/B1AST.hs
bsd-3-clause
296
0
8
57
143
81
62
10
1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Program.HcPkg -- Copyright : Duncan Coutts 2009, 2013 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This module provides an library interface to the @hc-pkg@ progra...
x-y-z/cabal
Cabal/Distribution/Simple/Program/HcPkg.hs
bsd-3-clause
14,214
0
18
3,628
2,855
1,521
1,334
250
5
{- Criterion-based benchmarks. Criterion displays and minimises the impact of time variance and charts the results. -} import Criterion.Main import System.Environment (withArgs) import qualified HledgerMain main = defaultMain [ bench "balance_100x100x10" $ nfIO $ withArgs ["balance", "-f", "100x100x10.ledger"...
kmels/hledger
tools/criterionbench.hs
gpl-3.0
362
0
9
58
62
35
27
5
1
module Type.Constrain.Literal where import qualified AST.Literal as L import qualified Reporting.Error.Type as Error import qualified Reporting.Region as R import qualified Type.Type as T import qualified Type.Environment as Env constrain :: Env.Environment -> R.Region -> L.Literal -> T.Type -> I...
Axure/elm-compiler
src/Type/Constrain/Literal.hs
bsd-3-clause
1,004
0
14
322
321
165
156
31
9
import InferTests (allTests) import qualified Test.Framework as TestFramework main :: IO () main = TestFramework.defaultMain allTests
aleksj/lamdu
test/test_Infer.hs
gpl-3.0
135
0
6
17
37
21
16
4
1
{-# LANGUAGE RecordWildCards #-} module T8448 where data R = R {r :: Int} f x = undefined [] {r = x}
urbanslug/ghc
testsuite/tests/rename/should_fail/T8448.hs
bsd-3-clause
104
0
8
25
41
24
17
4
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Control.Teardown.Internal.Printer where import RIO hiding ((<>)) import Data.Typeable (typeOf) import qualified RIO.Text as Text import Data.Text.Prettyprint.Doc import Control.Teardown.Internal.Types treeTrunk :: Int -> In...
roman/Haskell-teardown
src/Control/Teardown/Internal/Printer.hs
isc
2,429
0
21
723
772
398
374
58
8
import Control.Applicative import Control.Monad import Data.List data KnightPos = KP Int Int KnightPos | Start deriving Show instance Eq KnightPos where (KP lx ly lk) == (KP rx ry rk) = lx == rx && ly == ry -- && lk == rk -- Start == Start...
sukhmel/experiments.haskell
knight.hs
mit
2,030
0
13
1,019
641
346
295
38
1
-- List Sum using folds mysuml xs = foldl (+) 0 xs mysumr xs = foldr (+) 0 xs smallestDivisor n = helper 2 n where helper x n | x * x > n = n | n `rem` x == 0 = x | otherwise = if x ==2 then helper (x+1) n else he...
gitrookie/functionalcode
code/Haskell/snippets/folds.hs
mit
763
0
11
281
342
174
168
16
2
{-# LANGUAGE OverloadedStrings #-} import Test.Hspec import Database.Persist.Quasi import Database.Persist.Types main :: IO () main = hspec $ do describe "tokenization" $ do it "handles normal words" $ tokenize " foo bar baz" `shouldBe` [ Spaces 1 , Token "fo...
gbwey/persistentold
persistent/test/main.hs
mit
2,728
0
19
1,196
645
318
327
67
1
{-# LANGUAGE PackageImports, TypeSynonymInstances, FlexibleInstances #-} module Prelude( module CorePrelude, module IORef, (++), unpack, error, P.show, P.length ) where import CorePrelude hiding (on, error) import qualified "base" Prelude as P import qualified Data.Text as T import Data.IORe...
zsedem/haskell-playground
gitcommander/src/Prelude.hs
mit
712
0
8
161
210
127
83
27
1
module Test.Hspec.Wai.Matcher ( ResponseMatcher(..) , match ) where import Control.Monad import Data.Monoid import Data.Functor import Data.String import Data.Text.Lazy.Encoding (encodeUtf8) import qualified Data.ByteString.Lazy as LB import Network.HTTP.T...
begriffs/hspec-wai
src/Test/Hspec/Wai/Matcher.hs
mit
2,357
0
16
542
652
349
303
48
2
{-# LANGUAGE MultiParamTypeClasses #-} module Hafer.Export.ExportMethod ( module Hafer.Export.ExportMethod ) where class ExportMethod g o where exprt :: g -> o
ooz/Hafer
src/Hafer/Export/ExportMethod.hs
mit
167
0
7
28
37
22
15
5
0
{-# LANGUAGE TemplateHaskell, DeriveFunctor #-} module Timed where import Control.Lens import Control.Arrow ((&&&)) import Control.Lens.TH import Data.List import Data.Ord import List data Timed m = Timed { _ttl :: Int, _hits :: Int, _message :: m } deriving Show $(makeLenses ...
paolino/touchnet
Timed.hs
mit
936
0
11
221
413
222
191
26
1
{-# LANGUAGE Safe #-} module Control.Concurrent.Transactional.EventHandle ( EventHandle (), newEventHandle, wrapEvent ) where import Control.Concurrent.Transactional.Event.Base import Control.Monad (void) import Data.IORef (IORef, newIORef, mkWeakIORef) -- |Event handles are values that fire an event when they ...
YellPika/Hannel
src/Control/Concurrent/Transactional/EventHandle.hs
mit
991
0
13
185
213
117
96
19
1
module HTMLTokenizer.Parsing ( token, attribute, name, ) where import HTMLTokenizer.Prelude hiding (takeWhile) import HTMLTokenizer.Data import Data.Attoparsec.Text import HTMLEntities.Parser (htmlEntity) import qualified Text.Builder as A import qualified HTMLTokenizer.MonadPlus as B import qualified VectorBuil...
nikita-volkov/html-tokenizer
library/HTMLTokenizer/Parsing.hs
mit
5,270
0
24
1,778
1,576
782
794
-1
-1
{-# LANGUAGE OverloadedStrings, TemplateHaskell, QuasiQuotes, TypeFamilies, ViewPatterns, MultiParamTypeClasses, FlexibleInstances #-} module Main where {- Simple demonstration of building routes Note: Look at the code in subsites/ for an example of building the same functionality as a subsite. -} import Wai.Route...
ajnsit/wai-routes
examples/hello-world/src/Main.hs
mit
3,022
0
14
616
570
305
265
65
2
{-# LANGUAGE CPP #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} -- | A 'MonadSTM' implementation, which can be run on top of 'IO' or -- 'ST'. module Test.DejaFu.STM ( -- * The @STMLike@ Monad STMLike ...
bitemyapp/dejafu
Test/DejaFu/STM.hs
mit
4,959
0
13
1,056
1,323
722
601
82
2
module Sieve ( primesUpTo ) where -- You should not use any of the division operations when implementing -- the sieve of Eratosthenes. import Prelude hiding (div, divMod, mod, quot, quotRem, rem, (/)) import Data.Set (Set) import qualified Data.Set as Set primesUpTo :: Integer -> [Integer] p...
enolive/exercism
haskell/sieve/src/Sieve.hs
mit
613
0
11
146
220
128
92
12
1
module Geometry.Vector ( Scalar, Vector, (<+>), (<->), (<*>), mult, vecSum, normalise, computeBisector, computeReflection ) where import Prelude hiding ((<*>)) type Scalar = Double type Vector = (Scalar, Scalar, Scalar) (<+>) :: Vector -> Vector -> Vector (x1, y1, z1) <+> (x2, y2, z2) = (x1+x2, y...
dongy7/raytracer
src/Geometry/Vector.hs
mit
1,155
0
10
247
575
333
242
35
1
{-# LANGUAGE RecordWildCards #-} module Main where import Control.Applicative import Data.Attoparsec.ByteString.Char8 import qualified Data.ByteString as B import Data.ByteString.Builder import qualified Data.ByteString.Char8 as C import Data.Char (toLower) import Dat...
nickspinale/nix-tex
tl-pkgs/tl2nix/Main.hs
mit
4,280
1
20
1,257
1,192
632
560
76
4
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RecordWildCards #-} module Eval ( evalText, evalFile, runParseTest, safeExec, -- testing runASTinEnv, basicEnv, fileToEvalForm, textToEvalForm, getFileContents ) where import Prim ( primEnv, unop ) import Parser ( ...
write-you-a-scheme-v2/scheme
src/Eval.hs
mit
8,481
0
16
1,904
3,294
1,667
1,627
192
7
{-# LANGUAGE GADTs #-} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} module DataAnalysis.Application.Prelude ( runAnalysisAppDb ) where import Control.Monad.Logger -- import Control.M...
teuffy/min-var-ci
src/DataAnalysis/Application/Prelude.hs
mit
3,251
0
23
1,114
784
405
379
78
1
{-# LANGUAGE CPP, NoImplicitPrelude, PackageImports #-} module Text.Read.Compat ( module Base ) where import "base-compat" Text.Read.Compat as Base
haskell-compat/base-compat
base-compat-batteries/src/Text/Read/Compat.hs
mit
151
0
4
21
23
17
6
4
0
#! /usr/bin/env runhaskell import Text.Pandoc.JSON main :: IO () main = toJSONFilter includeMarkdown includeMarkdown :: Block -> IO Block includeMarkdown cb@(CodeBlock (_,_,namevals)_) = case lookup "markdown" namevals of Just f -> return . RawBlock (Format "markdown") =<< readFile f Nothing -> ...
spanners/dissertation
dissertation/includeMarkdown.hs
mit
360
0
12
73
124
62
62
9
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata-launchspecifications-tagspecifications.html module Stratosphere.Reso...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/EC2SpotFleetSpotFleetTagSpecification.hs
mit
2,425
0
12
205
265
154
111
28
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-simpledb.html module Stratosphere.Resources.SDBDomain where import Stratosphere.ResourceImports -- | Full ...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/SDBDomain.hs
mit
1,252
0
14
189
186
108
78
24
1
module Yi.UI.Batch (start) where import Yi.UI.Common import Yi.Config -- | Initialise the ui start :: UIBoot start _cfg _ch _outCh _ed = do mapM_ putStrLn ["Starting 'batch' UI...", "Are you sure you compiled with support for any real UI?", "(for example, pass -fvty to cab...
codemac/yi-editor
src/Yi/UI/Batch.hs
gpl-2.0
358
0
8
104
66
37
29
9
1
-- #hide -------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.GL.DataType -- Copyright : (c) Sven Panne 2002-2009 -- License : BSD-style (see the file libraries/OpenGL/LICENSE) -- -- Maintainer : sven.panne@aedion.de -- Stability ...
ducis/haAni
hs/common/Graphics/Rendering/OpenGL/GL/DataType.hs
gpl-2.0
5,061
0
9
944
840
445
395
105
31
-- create pqueue do p1 <- newTChanIO p2 <- newTChanIO p3 <- newTChanIO pQueue <- newTVarIO (p1, p2, p3) --read pqueue atomically $ do (p1, p2, p3) <- readTVar pQueue
RocketPuppy/PupEvents
PQueue.hs
gpl-3.0
195
0
9
58
72
35
37
-1
-1
{-# LANGUAGE OverloadedStrings, DeriveGeneric #-} module Estuary.Types.Database where import Database.SQLite.Simple import Database.SQLite.Simple.FromRow import Database.SQLite.Simple.ToRow import Database.SQLite.Simple.FromField import Database.SQLite.Simple.ToField import Database.SQLite.Simple.Ok import Data.Map a...
d0kt0r0/estuary
server/src/Estuary/Types/Database.hs
gpl-3.0
4,987
0
13
805
1,381
750
631
121
1
module System.DevUtils.Base.Url.File ( File(..), defaultFile ) where data File = File { _path :: FilePath } deriving (Show, Read) defaultFile :: File defaultFile = File { _path = "/tmp/poop" }
adarqui/DevUtils-Base
src/System/DevUtils/Base/Url/File.hs
gpl-3.0
201
0
8
38
65
41
24
9
1
{-# LANGUAGE PackageImports #-} import "TS" 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 (threadDelay) ma...
minamiyama1994/T-shirt-creator
devel.hs
gpl-3.0
703
0
10
123
186
101
85
23
2
#!/usr/bin/env runhaskell -- -- Copyright 2014 Wesley Tanaka <http://wtanaka.com/> -- -- This file is part of https://github.com/wtanaka/haskell -- -- https://github.com/wtanaka/haskell is free software: you can -- redistribute it and/or modify it under the terms of the GNU General -- Public License as published by the...
wtanaka/haskell
Wc.hs
gpl-3.0
5,516
0
16
1,093
1,368
730
638
109
4
{-# LANGUAGE NoMonomorphismRestriction #-} module Sound.Tidal.Dirt where import Sound.OSC.FD import qualified Data.Map as Map import Control.Applicative import Control.Concurrent.MVar --import Visual import Data.Colour.SRGB import Data.Colour.Names import Data.Hashable import Data.Bits import Data.Maybe import Syst...
unthingable/Tidal
Sound/Tidal/Dirt.hs
gpl-3.0
5,767
0
17
2,256
1,736
913
823
121
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-emr/gen/Network/AWS/EMR/DescribeJobFlows.hs
mpl-2.0
5,908
0
10
1,156
739
444
295
76
1
-- Copyright 2011 by Joshua Simmons <joshua.simmons@emptypath.com> module Canvas where import qualified Data.Map as M import Control.Monad.State import Text.Printf import Data.List import Game import SGF import qualified Graphics.Rendering.Cairo as C import Data.Ord (comparing) import Config data Canvas s c = -- stat...
kadoban/sgf
Canvas.hs
agpl-3.0
10,170
0
18
4,201
3,640
1,925
1,715
-1
-1
module Git.Command.PatchId (run) where run :: [String] -> IO () run args = return ()
wereHamster/yag
Git/Command/PatchId.hs
unlicense
85
0
7
15
42
23
19
3
1
{-# LANGUAGE OverloadedLists #-} {-# LANGUAGE DataKinds #-} module DumpSerialisationSpec where import Test.Hspec import Linear import Data.Maybe import Data.Foldable import Bio.Motions.Format.DumpDeserialisation import Bio.Motions.Format.DumpSerialisation import Bio.Motions.Format.Proto.Delta import Bio.Motions.Repr...
Motions/motions
test/DumpSerialisationSpec.hs
apache-2.0
2,377
0
20
690
725
395
330
58
1
module LibSpec where import Test.Hspec import Lib import Grammar libSpec :: IO() libSpec = hspec $ do describe "Lib" $ do it "Assign a value correctly" $ do let expression = [(Assign "a" (Int 1))] let expected = [("a", 1)] obtained <- eval expression emptyDataStore ...
JCepedaVillamayor/functional-compiler
test/LibSpec.hs
bsd-3-clause
2,551
0
24
848
928
454
474
52
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} {-# LAN...
dmjio/lifted-async
src/Control/Concurrent/Async/Lifted/Safe.hs
bsd-3-clause
11,525
0
14
2,327
3,756
1,998
1,758
-1
-1
----------------------------------------------------------------------------- -- | -- Module : XMonad.Doc.Extending -- Copyright : (C) 2007 Andrea Rossato -- License : BSD3 -- -- Maintainer : andrea.rossato@unibz.it -- Stability : unstable -- Portability : portable -- -- This module documents the xm...
CaptainPatate/xmonad-contrib
XMonad/Doc/Extending.hs
bsd-3-clause
50,029
0
3
9,658
99
96
3
2
0
module Database.DSH.Backend.Sql.Relational.Synthetic ( ) where
ulricha/dsh-sql
src/Database/DSH/Backend/Sql/Relational/Synthetic.hs
bsd-3-clause
71
0
3
13
13
10
3
2
0
module Score where import Control.Arrow ((&&&)) import Control.Monad import qualified Data.ByteString.Char8 as BS import Data.List (group,sort,sortBy,unfoldr,isPrefixOf) import Data.Ord (comparing) import qualified Data.Set as Set import Types import Command move_score :: Pt -> Pt -> Pt -> Pt move_score size ls ls_o...
msakai/icfpc2015
src/Score.hs
bsd-3-clause
2,248
0
13
638
793
432
361
-1
-1