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 DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-serviceuser/gen/Network/Google/Resource/ServiceUser/Projects/Services/List.hs
mpl-2.0
5,635
0
18
1,334
883
511
372
126
1
{- passman Copyright (C) 2018-2021 Jonathan Lamothe <jonathan@jlamothe.net> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later vers...
jlamothe/passman
app/Main.hs
lgpl-3.0
1,389
0
9
243
211
112
99
25
1
{-# LANGUAGE MultiWayIf #-} {-# LANGUAGE OverloadedStrings #-} module Lib.InlineFormatting where ------------------------------------------------------------------------------------ import qualified Data.DList as DList import Data.Foldable (toList) import ...
kernelim/gitomail
src/Lib/InlineFormatting.hs
apache-2.0
3,494
0
17
1,259
828
441
387
55
31
{- | Module : FileIO Description : Perform IO for the REPL Copyright : (c) 2014—2015 The F2J Project Developers (given in AUTHORS.txt) License : BSD3 Maintainer : Boya Peng <u3502350@connect.hku.hk> Stability : stable Portability : portable -} {-# LANGUAGE ScopedTypeVariables , DeriveD...
bixuanzju/fcore
lib/FileIO.hs
bsd-2-clause
3,119
0
16
1,061
827
420
407
76
3
module Evaluator ( evaluate ) where import Data.List (find) import Base termMap :: (Int -> Int -> Term) -> Term -> Term termMap onvar t = go 0 t where go index (TermVar var) = onvar index var go index (TermIfThenElse t1 t2 t3) = TermIfThenElse (go index t1) (go index t2) (go index t3) go index (TermA...
foreverbell/unlimited-plt-toys
tapl/simplesub/Evaluator.hs
bsd-3-clause
2,650
0
13
646
1,089
547
542
53
9
{-# LANGUAGE DeriveDataTypeable #-} -------------------------------------------------------------------- -- | -- Copyright : (c) Edward Kmett 2013 -- License : BSD3 -- Maintainer: Edward Kmett <ekmett@gmail.com> -- Stability : experimental -- Portability: non-portable -- ------------------------------------------...
ekmett/tasks
src/Control/Task/Promise.hs
bsd-3-clause
1,601
0
11
360
271
151
120
26
1
module DPLL where import Data.Foldable (asum) import Data.List (nub, (\\)) import Data.Map (Map ()) import qualified Data.Map as Map import Data.Maybe (listToMaybe, mapMaybe, fromJust) import Data.Set (Set ()) import qualified Data.Set as Set...
parsonsmatt/dpll
src/DPLL.hs
bsd-3-clause
11,539
185
11
2,629
2,378
1,342
1,036
188
3
#!/usr/bin/env runstaskell import Test.Hspec main :: IO () main = hspec $ describe "Prelude.head" $ do it "returns head of a list" $ do head [23..] `shouldBe` (23 :: Int)
soenkehahn/runstaskell
test/04.hs
bsd-3-clause
185
0
13
44
64
33
31
6
1
module Spring13.Week5.ExprT where data ExprT = Lit Integer | Add ExprT ExprT | Mul ExprT ExprT deriving (Show, Eq)
bibaijin/cis194
src/Spring13/Week5/ExprT.hs
bsd-3-clause
140
0
6
44
41
24
17
5
0
-- |A custom tokenizer that converts a string of hasp source code to a list of -- individual tokens, which can then be fed into the parser. module Tokenizer ( tokenize , Token ) where import Data.Sequence import Data.Foldable (toList) import Control.Monad (liftM) import Error type Token = String tokenize :: String...
aldld/hasp
src/Tokenizer.hs
bsd-3-clause
2,383
0
12
493
838
419
419
41
1
{-#LANGUAGE RecordWildCards #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies #-} {-# LANGUAGE OverloadedStrings, GADTs, FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving, MultiParamTypeClasses #-} module DirectoryServer where import Network hiding (accept, sClose) imp...
Garygunn94/DFS
.stack-work/intero/intero43064-Do.hs
bsd-3-clause
14,762
433
15
3,690
3,994
2,059
1,935
264
7
import System.Cmd (system) main :: IO () main = runTests tests runTests :: [(String, String)] -> IO () runTests ((desc, t):ts) = do putStrLn ("\nTesting " ++ desc ++ ":") system ("runhaskell ./tests/" ++ t ++ ".hs") runTests ts runTests [] = return () tests :: [(String, String)] tests = [("Partit...
radekm/crep
tests/run.hs
bsd-3-clause
398
0
10
95
190
98
92
13
1
module TIM.FunQuoter where import Language.Haskell.TH.Quote import qualified Language.Haskell.TH as TH import qualified Data.ByteString.Lazy.Char8 as C import Compiler import TIM.Compiler fun :: QuasiQuoter fun = QuasiQuoter { quoteExp = quoteExpFunTerm, quotePat = undefined, quoteType = undefi...
thomkoehler/FunLang
src/TIM/FunQuoter.hs
bsd-3-clause
479
0
10
92
120
74
46
14
1
{-# LANGUAGE StandaloneDeriving, GeneralizedNewtypeDeriving #-} module Data.TrieMap.OrdMap.Tests where import Data.TrieMap.OrdMap () import Data.TrieMap.Modifiers import qualified Data.TrieMap.TrieKey.Tests as TrieKeyTests import Test.QuickCheck deriving instance Arbitrary a => Arbitrary (Ordered a) tests :: Proper...
lowasser/TrieMap
Data/TrieMap/OrdMap/Tests.hs
bsd-3-clause
393
0
8
42
89
54
35
9
1
module GHC.RTS.Events.Analyze.Options ( Options(..) , parseOptions ) where import Options.Applicative import GHC.RTS.Events.Analyze.Types import GHC.RTS.Events.Analyze.Script import GHC.RTS.Events.Analyze.Script.Standard parseOptions :: IO Options parseOptions = customExecParser (prefs showHelpOnError) opts ...
WillSewell/ghc-events-analyze
src/GHC/RTS/Events/Analyze/Options.hs
bsd-3-clause
4,508
0
23
1,778
707
366
341
-1
-1
-- | This module provides the 'Complexity' and 'Certificate' type. -- The complexity and certificate types are fixed and represent a class of bounding functions for lower and upper -- timebounds as well as lower and upper spacebounds. module Tct.Core.Data.Certificate ( -- * Complexity Functions Complexity (..) ...
ComputationWithBoundedResources/tct-core
src/Tct/Core/Data/Certificate.hs
bsd-3-clause
8,406
0
16
2,209
2,572
1,364
1,208
164
1
-- | Provides lots of bas instances, pulled over from `Storable'. module Foreign.CStorable.BaseInstances where import Data.Word import Data.Int import Foreign.CStorable.TypeClass import Foreign.C.Types import Foreign.Storable import System.Posix.Types import Foreign.Ptr #define C(x) \ instance CStorable x where\ c...
maurer/c-storable-deriving
Foreign/CStorable/BaseInstances.hs
bsd-3-clause
1,082
0
8
152
558
261
297
-1
-1
-- ----------------------------------------------------------------------------- -- | -- Module : PixelParty.CmdLine -- Copyright : (c) Andreas-Christoph Bernstein 2011 -- License : BSD3-style (see LICENSE) -- -- Maintainer : andreas.bernstein@googlemail.com -- Stability : unstable -- Portability : ...
bernstein/pixelparty
src/PixelParty/CmdLine.hs
bsd-3-clause
1,126
0
12
200
222
124
98
17
1
module DataReferenceSpec (spec) where import Data.ByteString.IsoBaseFileFormat.Boxes import Data.ByteString.IsoBaseFileFormat.Util.BoxContent import Test.Hspec spec :: Spec spec = describe "IsBoxContent" $ describe "LocalMediaEntry" $ describe "boxSize" $ it "returns 0" $ let actual = bo...
sheyll/isobmff-builder
spec/DataReferenceSpec.hs
bsd-3-clause
643
0
11
192
137
76
61
18
1
{-| Copyright : (c) Dave Laing, 2017 License : BSD3 Maintainer : dave.laing.80@gmail.com Stability : experimental Portability : non-portable -} module Fragment.Let ( module X ) where import Fragment.Let.Ast as X import Fragment.Let.Helpers as X
dalaing/type-systems
src/Fragment/Let.hs
bsd-3-clause
261
0
4
51
29
21
8
4
0
{-# LANGUAGE ScopedTypeVariables, FlexibleContexts #-} module Generics.SingleRec.Arbitrary where import Prelude hiding (sum) import Control.Monad import Control.Applicative -- import System.Random import Test.QuickCheck import Generics.SingleRec.Base import Generics.SingleRec.Fixpoints -- Applicative and alternative ...
sebastiaanvisser/garbitrary
src/Generics/SingleRec/Arbitrary.hs
bsd-3-clause
2,685
0
14
626
1,058
535
523
54
1
{- | Module : $Header$ Description : Describes the generic util functions Copyright : None License : None Maintainer : tydax@protonmail.ch Stability : provisional The $Header$ module describes the generic util functions. -} module Utils ( distance, mean, rmdups ) where import ...
Tydax/ou-sont-les-femmes
src/Utils.hs
bsd-3-clause
1,163
0
12
269
252
136
116
24
3
-- | -- Module : $Header$ -- Copyright : (c) 2013-2015 Galois, Inc. -- License : BSD3 -- Maintainer : cryptol@galois.com -- Stability : provisional -- Portability : portable {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} module Notebook where import Cryptol.REPL.Monad (REPL...
GaloisInc/ICryptol
src/Notebook.hs
bsd-3-clause
6,511
0
21
1,496
1,723
932
791
114
2
{-# LANGUAGE ScopedTypeVariables #-} module Matterhorn.Emoji ( EmojiCollection , loadEmoji , emptyEmojiCollection , getMatchingEmoji , matchesEmoji ) where import Prelude () import Matterhorn.Prelude import qualified Control.Exception as E import Control.Monad.Except import q...
matterhorn-chat/matterhorn
src/Matterhorn/Emoji.hs
bsd-3-clause
4,134
0
19
1,019
815
438
377
67
3
module Lang.Lam ( module Lang.Lam.Syntax , module Lang.Lam.Passes.B_CPSConvert ) where import Lang.Lam.Syntax import Lang.Lam.CPS.Syntax () import Lang.Lam.CPS.Classes.Delta () import Lang.Lam.CPS.Instances.Delta () import Lang.Lam.CPS.Instances.Monads () import Lang.Lam.CPS.Instances.PrettySyntax () import Lang...
davdar/quals
src/Lang/Lam.hs
bsd-3-clause
463
0
5
47
127
89
38
13
0
{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeApplica...
achirkin/easytensor
easytensor/test/Numeric/Matrix/QRTest.hs
bsd-3-clause
6,018
2
16
2,154
2,393
1,270
1,123
169
2
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} #include "thyme.h" -- | FOR INTERNAL USE ONLY. m...
liyang/thyme
src/Data/Thyme/Internal/Micro.hs
bsd-3-clause
3,138
0
11
745
660
380
280
78
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} module FPNLA.Operations.LAPACK.Strategies.POTRF.BlocksSeq ( ) where import FPNLA.Matrix (Matrix, ...
mauroblanco/fpnla-examples
src/FPNLA/Operations/LAPACK/Strategies/POTRF/BlocksSeq.hs
bsd-3-clause
5,137
0
17
2,710
1,284
682
602
67
1
-- Thomas' misc utils (things that are missing in the standard libraries) module MUtils where import Monad(ap,unless,when) import List(groupBy,sortBy,sort) import Maybe(fromMaybe) --import ExceptM() -- all eta expansions because of the stupid monomorphism restriction infixl 1 #,#.,<#,@@, >#< -- Infix versions of two...
forste/haReFork
tools/base/lib/MUtils.hs
bsd-3-clause
2,593
7
11
630
1,224
636
588
64
3
module Lichen.Plagiarism.WinnowSpec where import Lichen.Plagiarism.Winnow import qualified Data.List.NonEmpty as NE import Text.Megaparsec import Test.Hspec import Test.QuickCheck import Lichen.Lexer prop_windows_size :: Int -> [Int] -> Bool prop_windows_size k l | k > 0 && k <= length l = case windows k l of ...
Submitty/AnalysisTools
test/Lichen/Plagiarism/WinnowSpec.hs
bsd-3-clause
2,289
0
18
837
703
349
354
35
3
module Name ( Name(..), name, freshName, freshNames ) where import Utilities import Data.Char import Data.Function import Data.Ord data Name = Name { name_string :: String, name_id :: Maybe Id } instance NFData Name where rnf (Name a b) = rnf a `seq` rnf b instance Show Name where show...
batterseapower/supercompilation-by-evaluation
Name.hs
bsd-3-clause
1,321
0
13
403
501
261
240
34
1
module Data.GI.GIR.Deprecation ( DeprecationInfo(..) , queryDeprecated ) where import qualified Data.Map as M import Data.Text (Text) import Text.XML (Element(elementAttributes)) import Data.GI.GIR.XMLUtils (firstChildWithLocalName, getElementContent) -- | Deprecation information on a symbol. data Deprec...
ford-prefect/haskell-gi
lib/Data/GI/GIR/Deprecation.hs
lgpl-2.1
972
0
13
222
206
115
91
20
2
-- | Provides uniformMatrix functions with Linear. module UniformLinear ( uniformMatrix2fv , uniformMatrix3fv , uniformMatrix4fv , uniformMatrix2x3fv , uniformMatrix3x2fv , uniformMatrix2x4fv , uniformMatrix4x2fv , uniformMatrix3x4fv , uniformMatrix4x3fv ) where import Graphics...
fujiyan/toriaezuzakki
haskell/opengl/uniform-matrix/UniformLinear.hs
bsd-2-clause
3,677
0
14
564
773
409
364
36
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module NanoML.Learn where import Control.Arrow (second) import...
ucsd-progsys/nanomaly
src/NanoML/Learn.hs
bsd-3-clause
4,013
0
18
873
1,316
705
611
89
4
module Distribution.Nixpkgs.Haskell.Hackage ( readHashedHackage, module Distribution.Hackage.DB ) where import Data.ByteString.Lazy ( ByteString ) import Data.Digest.Pure.SHA ( sha256, showDigest ) import Distribution.Hackage.DB import qualified Distribution.Hackage.DB.Parsed as Unparsed ( parsePackage ) import qualif...
psibi/cabal2nix
src/Distribution/Nixpkgs/Haskell/Hackage.hs
bsd-3-clause
1,315
0
16
244
234
138
96
16
1
{-# LANGUAGE CPP #-} module Bead.Config.Configuration ( InitTask(..) , Config(..) #ifdef SSO , SSOLoginConfig(..) , sSOLoginConfig #else , StandaloneLoginConfig(..) , standaloneLoginConfig #endif , defaultConfiguration , configCata , Usage(..) , substProgName #ifdef MYSQL , MySQLConfig(..) #else...
pgj/bead
src/Bead/Config/Configuration.hs
bsd-3-clause
6,138
0
17
1,338
909
545
364
76
3
module MoveDefSpec (main, spec) where import Test.Hspec import Language.Haskell.Refact.Refactoring.MoveDef import System.Directory import TestUtils -- --------------------------------------------------------------------- main :: IO () main = do hspec spec spec :: Spec spec = do -- -----------------...
kmate/HaRe
test/MoveDefSpec.hs
bsd-3-clause
41,665
0
18
7,561
5,189
2,560
2,629
417
1
module LdapImport where import CSH.LDAP import CSH.Eval.Model import CSH.Eval.Cacheable.Prim import CSH.Eval.Cacheable.Make import Data.UUID import Data.Maybe import Data.ByteString.Char8 as B import Data.Text as T import Ldap.Client.Search import System.Log.Logger ldapImport = withConfig $ \l -> do lgr <- getRoot...
robgssp/csh-eval
ldapImport.hs
mit
1,244
0
19
376
439
226
213
31
1
{-# LANGUAGE OverloadedStrings, FlexibleInstances, RecordWildCards #-} -- | Docker types. module Stack.Types.Docker where import Control.Applicative import Data.Aeson.Extended import Data.Monoid import Data.Text (Text) import Path -- | Docker configuration. data DockerOpts = DockerOpts {dockerEnable :: !Bool ...
CRogers/stack
src/Stack/Types/Docker.hs
bsd-3-clause
8,817
0
18
1,936
1,362
762
600
187
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="az-AZ"> <title>JSON View</title> <maps> <homeID>jsonview</homeID> <mapref location="map...
kingthorin/zap-extensions
addOns/jsonview/src/main/javahelp/help_az_AZ/helpset_az_AZ.hs
apache-2.0
959
77
66
156
407
206
201
-1
-1
{-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- -- Module : IDE.Command.VCS.Common.Workspaces -- Copyright : 2007-2011 Juergen Nicklisch-Franken, Hamish Mackenzie -- License : GPL Nothing -- -- Maintainer : maintainer@leksah.org -- Stab...
573/leksah
src/IDE/Command/VCS/Common/Workspaces.hs
gpl-2.0
3,054
0
18
761
628
357
271
58
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} module T14723 () where import Data.Coerce( coerce ) import Data.Kind (Type) import Data.Proxy (P...
sdiehl/ghc
testsuite/tests/polykinds/T14723.hs
bsd-3-clause
2,021
0
14
578
522
296
226
-1
-1
module ChangeCount_Test where import ChangeCount(changeCount) import Test.HUnit testWithEmptyCoinsList = TestCase $ assertEqual "changeCount 4 [] == 0" 0 (changeCount 4 []) testWithZeroMoney = TestCase $ assertEqual "changeCount 0 [1, 2, 5] == 18" 0 (changeCount 0 [1, 2, 5]) testWithUnSortedCoins = TestCase...
slon1024/functional_programming
haskell/ChangeCount_Test.hs
mit
501
0
9
85
130
72
58
10
1
{-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-orphans #-} {-# LANGUAGE TypeFamilies #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Config -- Copyright : (c) Spencer Janssen 2007 -- License : BSD3-style (see LICENSE) -- -- Maintainer : d...
ssavitzky/Honu
dotfiles/=xmonad/Config.hs
mit
14,378
0
15
3,275
2,074
1,278
796
175
1
-------------------------------------------------------------------------- -- Copyright (c) 2007-2010, ETH Zurich. -- All rights reserved. -- -- This file is distributed under the terms in the attached LICENSE file. -- If you do not find this file, copies can be found by writing to: -- ETH Zurich D-INFK, Universitätsta...
8l/barrelfish
hake/ARMv7.hs
mit
7,630
0
18
3,127
1,139
629
510
141
1
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} module Network.Slack where import Network.Slack.Api
owainlewis/slack
src/Network/Slack.hs
mit
191
0
4
26
14
10
4
4
0
module Sound.Wave where import qualified Data.ByteString as B import System.IO import System.FilePath ((</>)) import Data.Word import Data.List import Data.List.Split import Control.Monad.Trans.Maybe import Control.Monad.IO.Class import Control.Monad import Data.Functor data WaveFile = WaveFile { handle :: Handle ...
xymostech/hpong
src/Sound/Wave.hs
mit
3,317
0
14
632
1,222
632
590
80
1
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} module Y2017.M10.D23.Exercise where {-- Here I am! Rock me like a Hurricane! The NYT archives has a plethora of articles classified by subject, as we saw last week. This week, we're going to start teasing apart the archives by subject. Select a subject, get its index...
geophf/1HaskellADay
exercises/HAD/Y2017/M10/D23/Exercise.hs
mit
3,181
0
9
685
472
283
189
49
1
module GiveYouAHead.Build ( build ) where import System.Directory(getDirectoryContents,doesFileExist) import System.Process(createProcess,shell,waitForProcess) import GiveYouAHead.Common(getDataDir,writeF,readF) import GiveYouAHead.Build.File(getFilesList,getOptionsFromFile) ...
Qinka/GiveYouAHead
lib/GiveYouAHead/Build.hs
mit
2,618
2
14
836
860
444
416
54
6
module Main where import Graphics.GLUtil (offset0) import Control.Monad (unless) import Graphics.Rendering.OpenGL import Graphics.UI.GLUT hiding (exit) import Foreign.Marshal.Array (withArray) import Foreign.Storable (sizeOf) import System.Exit (exi...
triplepointfive/hogldev
tutorial04/Tutorial04.hs
mit
2,993
0
18
737
788
372
416
76
1
{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE DeriveGeneric #-} ----------------------------------------------------------------------------- -- -- Module : Network.Google.FusionTables -- Copyright : (c) 2013 Ryan Newton -- License : MIT -- -- Maintainer : Ryan Newton <ryan.newton@alum.mit.edu> -- Stabil...
rrnewton/hgdata
src/Network/Google/FusionTables.hs
mit
15,662
0
16
3,929
2,908
1,581
1,327
-1
-1
-- Roles {- Roles are a further level of specification for type variables parameters of datatypes. nominal representational phantom They were added to the language to address a rather nasty and long-standing bug around the correspondence between a newtype and its runtime representation. The fundamental d...
Airtnp/Freshman_Simple_Haskell_Lib
Intro/WIW/TypeFamiles/Roles.hs
mit
2,082
3
10
411
359
208
151
-1
-1
module StrawPoll.ListHelpers where dropTrailing :: (Eq a) => a -> [a] -> [a] dropTrailing item = reverse . (dropWhile (== item)) . reverse -- Add an empty item to the end of the list if we're editing the last item -- This is slow since it repeatedly calls length. padToMinLength :: Int -> a -> [a] -> [a] padToMinLengt...
cschneid/strawpollhs
src/shared/StrawPoll/ListHelpers.hs
mit
457
0
9
134
129
72
57
7
2
module Proteome.Data.Replace where import Prelude hiding (lines) import Ribosome.Data.Scratch (Scratch) import Proteome.Data.GrepOutputLine (GrepOutputLine) data Replace = Replace { _scratch :: Scratch, _lines :: NonEmpty GrepOutputLine } deriving stock (Eq, Show) makeClassy ''Replace
tek/proteome
packages/proteome/lib/Proteome/Data/Replace.hs
mit
304
0
9
50
83
49
34
-1
-1
import DartShots(findFinish, showFinish) tableCounts = [40..180] checkoutTable = map finishWithCount tableCounts where finishWithCount count = show count ++ ": " ++ (showFinish . findFinish $ count) main = putStr . unlines $ checkoutTable
urmastalimaa/darts-calculator
src/CheckoutTable.hs
mit
243
0
10
37
77
41
36
5
1
module Main where import Control.Monad import Control.Concurrent import Control.Concurrent.STM import System.Random import Text.Printf import Debug.Trace -- Forks type Fork = TMVar Int newFork :: Int -> IO Fork newFork i = newTMVarIO i takeFork :: Fork ->...
NickAger/LearningHaskell
ParallelConcurrent/diningPhilosophers/app/Main.hs
mit
1,706
0
15
446
481
244
237
40
1
{-# LANGUAGE ExistentialQuantification, RankNTypes, Rank2Types #-} module Pitch.Game (mkRoundState ,mkGameState ,playGame ,Player (..) ,defaultPlayer ,Hand (..) ,Bid (..) ,Play (..) ...
benweitzman/Pitch
src/Pitch/Game.hs
mit
11,889
0
21
5,228
3,759
1,968
1,791
236
6
-- The prime factors of 13195 are 5, 7, 13 and 29. -- What is the largest prime factor of the number 600851475143 ? import Data.List value :: Int value = 600851475143 sqrt' :: Int -> Int sqrt' n = ceiling $ sqrt(fromIntegral(n)) firstFactor :: Int -> [Int] firstFactor n = take 1 $ filter (\x -> (n `rem` x == 0)) [...
daniel-beard/projecteulerhaskell
Problems/p3.hs
mit
579
0
12
129
235
124
111
16
1
{-# LANGUAGE BangPatterns #-} module System.Random.SplitMix.Gen ( SplitMix64(..) , toSeedGamma , withSystemRandom , newSplitMix64 , newSeededSplitMix64 , nextInt32 , nextInt64 , nextDouble ) where import Data.Word (Word32, Word64) import Data.Int (Int64) import Data.Bits ((.|.), shiftR, testBit) impo...
nkartashov/SplitMix
src/System/Random/SplitMix/Gen.hs
mit
3,745
0
13
639
774
444
330
61
2
{-# LANGUAGE OverloadedStrings #-} module Main (main) where import Application import Settings import System.Random import Test.Hspec import Test.Hspec.Wai import WordList import Yesod.Core main :: IO () main = hspec spec spec :: Spec spec = withApp $ do describe "getting passphrases" $ do it "returns r...
pbrisbin/passphrase.me
test/Spec.hs
mit
1,238
0
15
348
297
150
147
35
1
{-# LANGUAGE DoAndIfThenElse #-} module DebCheck where import System.Process import Text.XML.HaXml hiding ((!),when) import Text.XML.HaXml.Posn (noPos) import System.FilePath import Control.Monad import Data.Maybe import System.IO import Data.Char import Data.Functor import qualified Data.ByteString.Char8 as BS impor...
nomeata/sat-britney
DebCheck.hs
gpl-2.0
2,598
0
24
748
742
405
337
53
5
module Parser ( exec, execString, dynDeepScope, dynShallowScope, staticShallowScope, staticDeepScope, ScopeConfig, SymbolValue(..), Environment, Log, Logunit(..), symtableValues, symtableName, envStack, wGetLine, staticChain ) where import Prelude hiding (foldr,concatM...
Dymanik/dymscope
src/Parser.hs
gpl-2.0
29,510
541
22
6,818
11,184
6,025
5,159
-1
-1
----------------------------------------------------------------------------- -- | -- Module : DSP.Filter.IIR.IIR -- Copyright : (c) Matthew Donadio 2003 -- License : GPL -- -- Maintainer : m.p.donadio@ieee.org -- Stability : experimental -- Portability : portable -- -- IIR functions -- -- IMPORTANT...
tolysz/dsp
DSP/Filter/IIR/IIR.hs
gpl-2.0
9,303
0
16
2,944
2,748
1,517
1,231
153
1
-- | module HuffmanSpec where import Test.Hspec import Test.Hspec.QuickCheck import Test.QuickCheck import Compression import Data.ByteString.Lazy as L import ArbInstances compress = caCompress huffmanAlg extract = caExtract huffmanAlg spec :: Spec spec = modifyMaxSuccess (const 1000) $ do describe "Basic sanity"...
kravitz/har
test/HuffmanSpec.hs
gpl-3.0
890
0
19
170
276
142
134
22
1
-- Copyright (c) 2012, Diego Souza -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of condit...
dgvncsz0f/sssfs
src/sssfs_stat.hs
gpl-3.0
3,598
0
13
1,316
561
315
246
34
6
{-# OPTIONS_GHC -fno-warn-orphans #-} {- COPIED FROM http://hackage.haskell.org/package/altfloat-0.3.1 -} {- - Copyright (C) 2009 Nick Bowler. - - License BSD2: 2-clause BSD license. See LICENSE for full terms. - This is free software: you are free to change and redistribute it. - There is NO WARRANTY, to the ex...
4ZP6Capstone2015/ampersand
src/Database/Design/Ampersand/Core/Poset.hs
gpl-3.0
6,600
0
24
1,411
973
545
428
47
3
module Text.MoodleMD.Reader (pandoc2questions, parseMoodleMD, readMoodleMDFile) where import Control.Applicative (pure, (<$>), (<*>), (*>), (<$), empty) import Control.Arrow import Control.Monad (mfilter) import Data.Maybe (fromMaybe) import Data.Tupl...
uulm-ai/moodle-md
src/Text/MoodleMD/Reader.hs
gpl-3.0
7,635
0
17
2,122
2,162
1,156
1,006
120
3
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE ViewPatterns #-} -- FIXME: Better solution for absTerm {-# LANGUAGE FlexibleContexts #-} -- | -- Copyright : (c) 2012 Benedikt Schmidt & Simon Meier -- License : GPL v3 (see LICENSE) -- -- Maintainer : Simon Meier <iridcode@gmail.com> -- -- Abstract intepretatio...
ekr/tamarin-prover
lib/theory/src/Theory/Tools/AbstractInterpretation.hs
gpl-3.0
5,641
0
23
1,755
1,170
628
542
82
9
{-# LANGUAGE RankNTypes, NoMonomorphismRestriction, FlexibleInstances, TypeSynonymInstances, MultiParamTypeClasses #-} {-| Local handlers to import and export bibliogräphic RDF. essentially defines our local terminology. -} module Data.RDF.Bibliography where import Data.List import Data.Maybe import Control.Appli...
FiskerLars/scorg
src/Data/RDF/Bibliography.hs
gpl-3.0
3,797
1
10
619
1,000
536
464
82
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-containeranalysis/gen/Network/Google/Resource/ContainerAnalysis/Projects/Notes/List.hs
mpl-2.0
5,855
0
19
1,419
960
554
406
134
1
module HelperSequences.A002262Spec (main, spec) where import Test.Hspec import HelperSequences.A002262 (a002262) main :: IO () main = hspec spec spec :: Spec spec = describe "A002262" $ it "correctly computes the first 22 elements" $ take 22 (map a002262 [0..]) `shouldBe` expectedValue where expectedValue...
peterokagey/haskellOEIS
test/HelperSequences/A002262Spec.hs
apache-2.0
369
0
10
59
166
99
67
10
1
{-# LANGUAGE ForeignFunctionInterface #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Utils -- Copyright : (c) The University of Glasgow 2001-2002, -- Simon Marlow 2003-2006, -- David Waern 2006-2009 -- License ...
nominolo/haddock2
src/Haddock/Utils.hs
bsd-2-clause
14,095
0
18
2,858
3,440
1,842
1,598
220
6
{-# LANGUAGE CPP, RecordWildCards, NamedFieldPuns, RankNTypes #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE NoMonoLocalBinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFunctor #-} -- | Planning how to build everything in a project. -- module Distribution.Client.ProjectPla...
themoritz/cabal
cabal-install/Distribution/Client/ProjectPlanning.hs
bsd-3-clause
156,063
0
29
46,138
20,645
11,144
9,501
2,039
20
module Main where import Lib import Data.List main :: IO () main = someFunc
tkasu/haskellbook-adventure
app/Main.hs
bsd-3-clause
78
0
6
16
27
16
11
5
1
{-# LANGUAGE Arrows #-} module Karamaan.Opaleye.Nullable where import Karamaan.Opaleye.QueryArr (QueryArr, Query) import Karamaan.Opaleye.Wire (Wire) import qualified Karamaan.Opaleye.ExprArr as E import qualified Karamaan.Opaleye.Wire as Wire import qualified Karamaan.Opaleye.Operators2 as Op2 import Control.Arrow (...
karamaan/karamaan-opaleye
Karamaan/Opaleye/Nullable.hs
bsd-3-clause
1,564
2
11
256
414
230
184
26
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE TypeSynonymInstances #-} {-| Module : Auto.BitString Description : Functions for operating on BitStrings Copyright : (c) Bo Joel Svensson, 2015 Michael Vollmer, 2...
iu-parfunc/AutoObsidian
src/Auto/BitString.hs
bsd-3-clause
4,908
0
12
1,173
1,291
710
581
-1
-1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ViewPatterns #-} -- | Support serializing Dalvik code in SSA form. -- -- This is binary serialization and it preserves sharing. Explicit -- functions are provided (as opposed to class instances) for two -- reasons: -- -- 1) Decoupling from...
travitch/dalvik
src/Dalvik/SSA/Internal/Serialize.hs
bsd-3-clause
35,087
0
21
12,343
10,922
5,459
5,463
877
28
{-# LANGUAGE TemplateHaskell, ScopedTypeVariables, TypeOperators, GADTs, EmptyDataDecls #-} module Reflex.Dynamic.TH (qDyn, unqDyn) where import Reflex.Dynamic import Language.Haskell.TH import Data.Data import Control.Monad.State -- | Quote a Dynamic expression. Within the quoted expression, you can use '$(unqDyn ...
bennofs/reflex
src/Reflex/Dynamic/TH.hs
bsd-3-clause
1,705
0
19
415
425
224
201
-1
-1
-- ------------------------------------------------------------ {- | Module : Yuuko.Text.XML.HXT.Arrow.Namespace Copyright : Copyright (C) 2005-2008 Uwe Schmidt License : MIT Maintainer : Uwe Schmidt (uwe@fh-wedel.de) Stability : experimental Portability: portable namespace specific arr...
nfjinjing/yuuko
src/Yuuko/Text/XML/HXT/Arrow/Namespace.hs
bsd-3-clause
13,516
316
19
3,043
2,700
1,495
1,205
221
2
{-# LANGUAGE Rank2Types, TypeSynonymInstances, QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving, TemplateHaskell, GADTs, FlexibleContexts #-} module Model where import Yesod import Database.Persist.GenericSql import Data.Maybe (fromJust, isJust, isNothing) import Data.Time.Clock(getCurrentTime, UTCTime(..)) impor...
alios/clearingstelle
Model.hs
bsd-3-clause
6,475
0
19
1,646
2,101
1,032
1,069
159
3
-- 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. module Duckling.Dimensions.EL ( allDimensions ) where import Duckling.Dimensions.Types allDimensions :: [Se...
facebookincubator/duckling
Duckling/Dimensions/EL.hs
bsd-3-clause
420
0
6
80
63
38
25
9
1
module Main where {- You should be able to pass as many .wav files as you like to this program and it should be able to parse them all and show their information on STDOUT. You should start by implementing a verbose mode by default and then you can consider implementing a quiet mode. You should have such data as: ...
CIFASIS/wavy
src/Info.hs
bsd-3-clause
6,003
0
15
1,328
1,712
842
870
124
2
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE...
sopvop/heist
src/Heist/Internal/Types/HeistState.hs
bsd-3-clause
21,473
0
17
4,769
3,550
1,988
1,562
263
1
{- Fastest when compiled as follows: ghc -O2 -optc-O3 -funbox-strict-fields -} ----------------------------------------------------------------------------- -- | -- Module : Data.SuffixTree -- Copyright : (c) Bryan O'Sullivan 2007 -- License : BSD-style -- Maintainer : bos@serpentine.com -- Stability ...
bos/suffixtree
Data/SuffixTree.hs
bsd-3-clause
13,050
0
18
3,566
3,094
1,700
1,394
186
5
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.BuildTargets -- Copyright : (c) Duncan Coutts 2012 -- License : BSD-like -- -- Maintainer : duncan@community.haskell.org -- -- Handling for user-specified build targets...
typelead/epm
Cabal/Distribution/Simple/BuildTarget.hs
bsd-3-clause
32,945
0
22
8,651
7,941
4,093
3,848
593
9
{-# OPTIONS_GHC -Wall #-} -- | API for this package module Classy ( -- * refernce frames newtonianBases , rotXYZ , rotX, rotY, rotZ , basesWithAngVel -- * classy state transformer and convenience functions , System , ...
ghorn/classy-dvda
src/Classy.hs
bsd-3-clause
1,930
0
5
1,022
222
150
72
62
0
{-# LANGUAGE OverloadedStrings #-} module Auth ( basicAuth ) where import Control.Monad.IO.Class (liftIO) import qualified Data.Aeson.Types as JS import qualified Data.ByteString as BS import qualified Data.ByteString.Base64 as Base import qualified Data.ByteString.Char8 as C import qualified Data.List ...
ashutoshrishi/blogserver
src/Auth.hs
bsd-3-clause
1,599
0
15
504
459
254
205
40
3
module BatchTests where import Common handleReq :: Handler (Req a) (Writer [[a]]) handleReq reqs = let results = map unReq reqs in tell [results] >> pure results run = execWriter . runBatch handleReq prop_batchAp x y = run (pair (req x) (req y)) === [[x, y]] prop_noBatchM x y = run (req x >> req y) === [[x], [y]] ...
zyla/monad-batch
test/BatchTests.hs
bsd-3-clause
980
0
14
236
596
305
291
-1
-1
{-# LANGUAGE RecordWildCards #-} module Network.HTTP2.Encode ( encodeFrame , encodeFrameChunks , encodeFrameHeader , encodeFrameHeaderBuf , encodeFramePayload , EncodeInfo(..) , encodeInfo ) where import Data.Bits (shiftR, (.&.)) import qualified Data.ByteString as BS import Data.ByteString.Internal...
bergmark/http2
Network/HTTP2/Encode.hs
bsd-3-clause
9,952
0
14
1,957
2,576
1,374
1,202
186
2
{-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | This is just a stub executable that uses dyre to read the config file and -- recompile itself. module Main ( main ) where import Data.Default (def) import Data.Semigroup ((<>)) import Data.Version import Options.Applicative import System.Directory import System.Log.Log...
teleshoes/taffybar
app/Main.hs
bsd-3-clause
1,617
0
13
390
327
168
159
42
2
module Commands.Test.Types where
sboosali/commands-core
tests/Commands/Test/Types.hs
mit
33
0
3
3
7
5
2
1
0
{-# OPTIONS_JHC -fno-prelude -fffi -funboxed-tuples #-} module Foreign.StablePtr( StablePtr(), castStablePtrToPtr, castPtrToStablePtr, newStablePtr, deRefStablePtr, freeStablePtr ) where import Jhc.Prim.Rts import Jhc.IO import Jhc.Type.Ptr import Jhc.Basics data StablePtr a castPtrToStab...
m-alvarez/jhc
lib/haskell-extras/Foreign/StablePtr.hs
mit
1,465
0
13
280
430
222
208
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-rds/gen/Network/AWS/RDS/AuthorizeDBSecurityGroupIngress.hs
mpl-2.0
8,116
0
13
1,437
883
534
349
108
1
module FilePath where import qualified System.Directory as D checkPath :: Bool -> FilePath -> String -> IO (Maybe String) checkPath dir path name = do exists <- predicate path return $ if exists then Nothing else Just $ "missing " ++ path_type ++ " of " ++ name where (predicate, path_type) = ...
jfeltz/dash-haskell
src/FilePath.hs
lgpl-3.0
560
0
12
121
189
101
88
14
3
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Num -- Copyright : (c) The University of Glasgow 1994-2002 -- License : see libraries/b...
green-haskell/ghc
libraries/base/GHC/Num.hs
bsd-3-clause
3,118
0
12
981
670
373
297
55
1
-- | Atomic monads for handling atomic game state transformations. module Game.LambdaHack.Atomic.MonadAtomic ( MonadAtomic(..) , broadcastUpdAtomic, broadcastSfxAtomic ) where import Data.Key (mapWithKeyM_) import Game.LambdaHack.Atomic.CmdAtomic import Game.LambdaHack.Common.Faction import Game.LambdaHack.Com...
Concomitant/LambdaHack
Game/LambdaHack/Atomic/MonadAtomic.hs
bsd-3-clause
1,458
0
11
268
286
155
131
24
1
{- (c) The University of Glasgow 2006 (c) The GRASP Project, Glasgow University, 1992-2000 Defines basic functions for printing error messages. It's hard to put these functions anywhere else without causing some unnecessary loops in the module dependency graph. -} {-# LANGUAGE CPP, DeriveDataTypeable, ScopedTypeVari...
GaloisInc/halvm-ghc
compiler/utils/Panic.hs
bsd-3-clause
9,101
0
18
2,469
1,652
850
802
138
10
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ViewPatterns #-} ----------------------------------------------------------------------------- -- | -- Module : Main -- Copyright : (c) 2012 Andreas-C. Bernstein -- License : BSD-style (see LI...
bernstein/breakout
src/Main.hs
bsd-3-clause
5,820
0
16
1,272
2,017
1,051
966
122
2
import Data.Char import Data.List import System.IO import Data.List.Split import qualified Data.Map as M import qualified Data.Set as S import System.Directory inDir = ""--HAS TO BE ADDED BEFORE COMPILING AND EXECUTING; example: "/home/user/Documents/document_set/" stopWordFile = ""--HAS TO BE ADDED BEFORE COMPILING A...
TakeLab/gpkex
getPhrFreq.hs
bsd-3-clause
4,400
0
18
1,033
2,139
1,078
1,061
98
3
{- | Module : $Header$ Description : Pretty printing for COL Copyright : (c) Wiebke Herding, C. Maeder, Uni Bremen 2004-2006 License : GPLv2 or higher, see LICENSE.txt Maintainer : till@informatik.uni-bremen.de Stability : provisional Portability : portable pretty printing -} module COL.Print_AS...
keithodulaigh/Hets
COL/Print_AS.hs
gpl-2.0
1,160
0
14
230
268
138
130
24
2