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 Galua.Spec.Parser.Monad ( Parser , onMissingClose , lexerM , runParser , parseError , ParseError ) where import Control.Monad import qualified Data.Text as Text import Control.Exception import Galua.Spec.Parser.Lexer import Debug.Trace newtype Parser a = Parser (RW -> Eithe...
GaloisInc/galua
galua-spec/src/Galua/Spec/Parser/Monad.hs
mit
5,150
0
17
2,248
1,716
906
810
112
12
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE FlexibleContexts #-} module Odin.Scripts.ArrowControl (arrowControl) where import Gelatin.SDL2 import SDL import Data.Monoid ((<>)) import Data.Maybe (mapMaybe) import Control.Lens import Odin.Core data Direction = North | East | South | West deriving (Show, Eq, Bounded)...
schell/odin
src/Odin/Scripts/ArrowControl.hs
mit
2,768
0
16
639
807
409
398
-1
-1
-- Copyright (c) Microsoft. All rights reserved. -- Licensed under the MIT license. See LICENSE file in the project root for full license information. {-# LANGUAGE QuasiQuotes, OverloadedStrings, RecordWildCards #-} module Bond.Template.Cpp.Enum_h (enum_h) where import Data.Monoid import Prelude import Data.Text.Laz...
innovimax/bond
compiler/Bond/Template/Cpp/Enum_h.hs
mit
1,231
0
10
192
185
117
68
16
3
module Main where import Evaluator import Parser import System.Environment (getArgs) parse :: String -> BrainfuckSource parse x = case parseBrainfuck x of (Left s) -> error s (Right bs) -> bs main :: IO () main = do argv <- getArgs case argv of (...
Rydgel/Brainfokt
src/Main.hs
mit
447
0
12
151
133
68
65
14
2
{-# OPTIONS_GHC -Wall #-} import Data.List -- | @xor@ performs XOR logic operation on a list of booleans xor :: [Bool] -> Bool xor = foldr (\ x y -> not (x==y)) False -- | @map'@ is an alternate implementation of map using foldr map' :: (a->b) -> [a] -> [b] map' f = foldr (\ x y -> (f x) : y) [] -- | @sieveSundara...
vaibhav276/haskell_cs194_assignments
higher_order/MoreFolds.hs
mit
790
0
12
157
283
155
128
13
1
{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE RecordWildCards #-} module Eurocode5.Fasteners.Bulldogs where import qualified Eurocode5.Wood.WoodCommon as WC data BDCat = C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | C9 | C10 | C11 deriving (Eq,Show) -- ^ Ensidig: C2,C4,C7,C9,C11 -- ^ Tosidig: C1,C1,C3,C5,C6,C8,C10 -- dat...
baalbek/eurocode5
src/Eurocode5/Fasteners/Bulldogs.hs
gpl-2.0
3,017
0
13
1,114
708
381
327
49
2
module Format where import Format.DataFormat
marco-vassena/svc
src/Format.hs
gpl-3.0
46
0
4
6
9
6
3
2
0
{-# LANGUAGE FlexibleContexts #-} module Parsing (parse, validCharacters, balance) where import Text.Parsec ((<|>)) import qualified Text.Parsec as Parsec -- import Text.Parsec.Error (newErrorMessage, Message(..)) -- import Text.Parsec.Pos (newPos) import qualified Data.Set as Set import qualified Data.Map as Map imp...
eriksvedang/Carp
src/Parsing.hs
mpl-2.0
16,816
12
18
6,055
5,225
2,552
2,673
365
17
module ISO where import Data.Maybe import Data.Void -- a type of `Void` have no value. -- So it is impossible to construct `Void`, -- unless using undefined, error, unsafeCoerce, infinite recursion, etc -- And there is a function -- absurd :: Void -> a -- That get any value out of `Void` -- We can do this becuase we c...
ice1000/OI-codes
codewars/101-200/algebraic-isomorphism.hs
agpl-3.0
7,690
0
11
2,004
2,948
1,635
1,313
125
3
module RemoteCache( -- * Types RemoteCache, -- * Functions newRemoteCache ) where import Control.Concurrent( Chan,MVar,forkIO,newEmptyMVar,putMVar,takeMVar,newChan,readChan,writeChan) import Data.ByteString(ByteString) import qualified Data.ByteString as B import Data.Time(NominalDiffTime) impo...
qpliu/lecache
hs/RemoteCache.hs
lgpl-3.0
7,677
0
16
2,444
2,110
1,116
994
147
1
module Main where import Control.Error import C18.Actions import Opts main :: IO () main = runScript . action =<< parseActions
erochest/c18sgml
app/Main.hs
apache-2.0
163
0
6
56
40
23
17
6
1
{-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE CPP #-} #if __GLASGOW_HASKELL__ < 710 {-# LANGUAGE OverlappingInstances #-} #endif module Data.Convert.Base where import Prelude import Co...
wdanilo/convert
src/Data/Convert/Base.hs
apache-2.0
2,761
0
9
639
706
378
328
-1
-1
-- 232792560 nn = 20 tryReduce ds n d = if m == 0 && isDivisible then tryReduce ds q d else n where (q,m) = n `divMod` d isDivisible = all (\x -> q `mod` x == 0) ds smallestMult n = foldl (tryReduce ds) p ds where p = product ds ds = [2..n] main = putStrLn $ show $ smallestMult nn
higgsd/euler
hs/5.hs
bsd-2-clause
313
0
11
95
147
79
68
8
2
-- http://www.codewars.com/kata/5512ec4bbe2074421d00028c module Stream where import Control.Arrow import Control.Applicative import Stream.Internal -- Defined in Stream.Internal: -- data Stream a = a :> Stream a -- infixr :> -- | Get the first element of a stream. headS :: Stream a -> a headS (x :> xs) = x ...
Bodigrim/katas
src/haskell/B-Functional-streams.hs
bsd-2-clause
2,601
0
13
623
944
500
444
47
2
-- | C simulation of a RISK kernel. module RISK.Sim ( generateSimulator ) where import Language.GIGL import Text.Printf import RISK.Compile import RISK.Config import RISK.Kernel import RISK.Spec generateSimulator :: Spec -> IO () generateSimulator spec = writeFile "risk_sim.c" $ unlines [ "// RISK Simulator" ...
tomahawkins/risk
RISK/Sim.hs
bsd-2-clause
1,424
0
13
299
286
155
131
39
1
module Main where main :: IO () main = putStrLn "<<<projName>>> Sample application!"
creswick/Newt
tests/testFiles/dirTemplates/cabalProject/appsrc/Main.hs
bsd-3-clause
85
0
6
13
22
12
10
3
1
module Handler.Api.Resource where import Import import Data.Aeson postApiResourceExists :: Handler TypedContent postApiResourceExists = return $ toTypedContent $ object [ "success" .= True , "result" .= True ]
duplode/dohaskell
src/Handler/Api/Resource.hs
bsd-3-clause
242
0
8
59
53
30
23
8
1
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Distribution.Server.Users.AuthToken ( AuthToken , parseAuthToken, parseAuthTokenM, renderAuthToken , OriginalToken , convertToken, viewOriginalToken, generateOriginalToken , parseOri...
edsko/hackage-server
Distribution/Server/Users/AuthToken.hs
bsd-3-clause
3,644
0
12
692
861
469
392
71
2
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.AMD.GPUShaderInt64 -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable ...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/AMD/GPUShaderInt64.hs
bsd-3-clause
2,129
0
4
268
229
160
69
65
0
module RunModes ( chkKeyFileExists , chkOverwrite , chkTeXFilesExist , readKeyFile , readTeXFiles , processFiles , findAllFiles , getAllKeys , processKeys ) where --------------------------------------------------------------------- -- This module contains implementations for th...
MWRuszczycky/Chemno
src/RunModes.hs
bsd-3-clause
9,056
0
20
2,443
1,957
1,010
947
141
4
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} module SOPBench.Show where import Data.List (intersperse) import Generics.SOP gshow :: (Generic a, HasDatatypeInfo a, All2 Show (Code a)) => a -> String gshow x = gshowsPrec 0 x "" gshowsPrec :: (Generic a, HasDatatypeInfo a, ...
well-typed/generics-sop
generics-sop/bench/SOPBench/Show.hs
bsd-3-clause
1,739
0
17
438
704
354
350
51
3
{-# LANGUAGE OverloadedStrings #-} module SignedAuth.Sign where import qualified Crypto.Error as Crypto import qualified Crypto.PubKey.Ed25519 as Ed25519 import qualified Data.ASN1.BinaryEncoding as ASN1 import qualified Data.ASN1.Encoding as ASN1 import Data.ASN1.Prim import qualified D...
nejla/auth-service
auth-service-core/src/SignedAuth/Sign.hs
bsd-3-clause
4,022
0
13
808
1,025
525
500
93
3
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ExistentialQuantification #-} {-# OPTIONS_GHC -Wno-incomplete-record-updates #-} module TcHoleErrors ( findValidHoleFits, tcFilterHoleFits , tcCheckHoleFit, tcSubsumes , withoutUnification , fromPureHFPlugin ...
sdiehl/ghc
compiler/typecheck/TcHoleErrors.hs
bsd-3-clause
46,690
86
35
14,903
6,102
3,286
2,816
455
17
import Test.HUnit import Core.Partition import Data.Word (Word8) main :: IO () main = do runTestTT suite return () t_fromList_toList = "fromList, toList" ~: test [ let xs = [(1, 'a'), (2, 'c'), (1, 'z'), (0, maxBound)] in toList ((fromList xs) :: PartitionL Char) ~=? xs , let xs = [(5, 32), (19...
radekm/crep
tests/Partition.hs
bsd-3-clause
8,682
0
13
2,669
5,061
2,661
2,400
189
1
{-| Copyright : (c) Dave Laing, 2017 License : BSD3 Maintainer : dave.laing.80@gmail.com Stability : experimental Portability : non-portable -} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} module Fragment.TmVar.Rules.Type.Infer.Offline ( TmVarInferTypeCon...
dalaing/type-systems
src/Fragment/TmVar/Rules/Type/Infer/Offline.hs
bsd-3-clause
919
0
8
165
217
128
89
16
1
module Language.LaTeX.Length ( -- Units inch, pt, em, cm, mm, ex, pc, sp, bp, dd, cc, mu -- Dynamic Length , stretch -- Predefined lengths , parindent, textwidth, linewidth, textheight, parsep, parskip, baselineskip , baselinestrech, fill, columnsep, columnseprule, mathindent, oddsidemargin , evensi...
np/hlatex
Language/LaTeX/Length.hs
bsd-3-clause
4,547
0
7
566
980
599
381
99
1
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-2006 \section[RnEnv]{Environment manipulation for the renamer monad} -} {-# LANGUAGE CPP, MultiWayIf #-} module RnEnv ( newTopSrcBinder, lookupLocatedTopBndrRn, lookupTopBndrRn, lookupLocatedOccRn, lookupOccRn, lookupOccRn_maybe, ...
mettekou/ghc
compiler/rename/RnEnv.hs
bsd-3-clause
97,041
92
35
28,187
16,274
8,394
7,880
1,206
10
{-# LANGUAGE TemplateHaskell #-} module Gitter.Types ( Gitter (..) , ResourcePath , Room (..) , RoomId , RoomUri ) where import Data.Aeson.TH (SumEncoding (TaggedObject), contentsFieldName, defaultOptions, deriveJSON, fieldLabelModifier, sumEncoding,...
cblp/haskell-gitter
src/Gitter/Types.hs
bsd-3-clause
939
0
9
251
218
135
83
31
0
{-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} ----------------------------------------------------------------------------- -- | -- Module :...
ddssff/lens
src/Control/Lens/Internal/Level.hs
bsd-3-clause
5,767
0
19
1,313
1,459
775
684
92
2
foldr1 f z [] = z foldr1 f z (x:xs) = f x (foldr1 f z xs)
abhinav-mehta/CipherSolver
src/other/Foldr1.hs
bsd-3-clause
60
4
7
19
53
26
27
2
1
module PackageTests.Tests(tests) where import PackageTests.PackageTester import qualified PackageTests.BenchmarkStanza.Check import qualified PackageTests.TestStanza.Check import qualified PackageTests.DeterministicAr.Check import qualified PackageTests.TestSuiteTests.ExeV10.Check import Control.Monad import Data.V...
garetxe/cabal
Cabal/tests/PackageTests/Tests.hs
bsd-3-clause
12,005
0
22
2,973
2,159
1,026
1,133
179
1
{-# LANGUAGE OverloadedStrings #-} module Text.Digestive.Heist.Extras.List ( dfInputListStatic , dfInputListCustom , dfInputListSpan ) where import Data.Map.Syntax ((##)) import qualified Data.Text as T import Data.Text (Text) import Heist import Heist.Interpreted import qualified Text.XmlHtml as X import Text.D...
cimmanon/digestive-functors-heist-extras
src/Text/Digestive/Heist/Extras/List.hs
bsd-3-clause
8,712
30
23
1,545
1,882
954
928
123
3
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RecordWildCards #-} module Numeric.LinearAlgebra.Arnoldi ( Arpack, eig -- * Options , Options(..), Which(..) -- * Exceptions , MaxIterations(..) , NoShifts(..) ...
ttuegel/arpack
src/Numeric/LinearAlgebra/Arnoldi.hs
bsd-3-clause
834
0
13
184
225
134
91
23
1
{-| Copyright : (c) Dave Laing, 2017 License : BSD3 Maintainer : dave.laing.80@gmail.com Stability : experimental Portability : non-portable -} module Fragment.IsoRec.Rules.Kind.Infer.SyntaxDirected ( ) where
dalaing/type-systems
src/Fragment/IsoRec/Rules/Kind/Infer/SyntaxDirected.hs
bsd-3-clause
220
0
3
36
14
11
3
1
0
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- | Arbitrary instances, and wrappers around types from Ray.Types, -- for more useful Arbitrary instances. ...
bergey/panther
tests/Types.hs
bsd-3-clause
3,631
0
12
909
1,140
610
530
76
1
{-# LANGUAGE QuasiQuotes #-} module KnownCodes where import Data.Word import qualified Data.Vector.Storable as V import BakedVector code2RawCode :: Word16 -> Maybe Word16 code2RawCode code = knownRawCodes V.!? fromIntegral code firstObjectCode :: Word16 firstObjectCode = 1000 lastObjectCode :: Word16 -- Empirical...
colinba/tip-toi-reveng
src/KnownCodes.hs
mit
186,077
0
6
98,397
93
57
36
14
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} module System.HFind.Expr.Parser ( parsePred , parseExpr , parseLetBinding , parseStringInterp , parseCmdLineArg , ParseError ) where import Data.Char import ...
xcv-/hfind
src/System/HFind/Expr/Parser.hs
mit
12,087
0
21
3,760
3,917
1,986
1,931
283
11
import Euterpea shared = [ -- Wise men / Shall I / Take my f 5 hn, c 6 hn, -- say only / stay? Would it / hand, take my f 5 $ hn + qn, g 5 en, a 5 en, -- fools rush / be a / whole life as 5 hn, a 5 hn, -- in, But / sin if / too. For g 5 $ hn + qn + en, c 5 en, ...
steinz/CantHelpFallingInLove
hs/cant_stop_falling_in_love.hs
mit
1,840
0
10
836
579
300
279
56
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-rds/gen/Network/AWS/RDS/DescribeAccountAttributes.hs
mpl-2.0
3,986
0
10
733
397
243
154
52
1
module GramLab.Data.Diff.FuzzyEditTree ( make , apply , check ) where import GramLab.Data.Diff.EditTree (split3) import qualified GramLab.Data.Diff.EditTree2 as ET2 import qualified GramLab.Data.Diff.E...
gchrupala/morfette
src/GramLab/Data/Diff/FuzzyEditTree.hs
bsd-2-clause
4,919
0
16
1,926
1,636
852
784
85
3
{-# LANGUAGE RankNTypes #-} module Main where import Control.Monad (when, join, forever) import Control.Monad.IO.Class import qualified Data.ByteString.Char8 as C8 import qualified Data.ByteString.Internal as BI import qualified Data.ByteString.Lazy as LB import qualified Network.Pcap as P import qualified Network.Pca...
BrandKarma/harley
executable/Main.hs
bsd-3-clause
8,439
0
20
2,133
2,489
1,263
1,226
172
4
-- Copyright (c) 2015 Eric McCorkle. All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- -- 1. Redistributions of source code must retain the above copyright -- notice, this list of conditi...
emc2/chill
src/IR/FlatIR/LLVMGen/Utils.hs
bsd-3-clause
3,302
4
13
690
420
261
159
34
2
----------------------------------------------------------------------------------------- {-| Module : Print Copyright : (c) Daan Leijen 2003 License : wxWindows Maintainer : wxhaskell-devel@lists.sourceforge.net Stability : provisional Portability : portable Printer abstraction layer. See @sample...
sherwoodwang/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/Print.hs
lgpl-2.1
15,717
0
17
4,249
2,981
1,512
1,469
209
4
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="hi-IN"> <title>Context Alert Filters | ZAP Extension</title> <maps> <homeID>top</homeID> ...
0xkasun/security-tools
src/org/zaproxy/zap/extension/alertFilters/resources/help_hi_IN/helpset_hi_IN.hs
apache-2.0
983
85
52
161
400
211
189
-1
-1
{-# LANGUAGE TemplateHaskell, Rank2Types, CPP #-} #ifndef NO_SAFE_HASKELL {-# LANGUAGE Trustworthy #-} #endif -- | Test all properties in the current module, using Template Haskell. -- You need to have a @{-\# LANGUAGE TemplateHaskell \#-}@ pragma in -- your module for any of these to work. module Test.QuickCheck.All( ...
srhb/quickcheck
Test/QuickCheck/All.hs
bsd-3-clause
7,927
0
20
1,619
1,451
795
656
91
5
{-# LANGUAGE BangPatterns, CPP, NondecreasingIndentation, ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} -- NB: we specifically ignore deprecations. GHC 7.6 marks the .QSem module as -- deprecated, although it became un-deprecated later. As a result, using 7.6 -- as your bootstrap compiler ...
frantisekfarka/ghc-dsi
compiler/main/GhcMake.hs
bsd-3-clause
82,584
0
35
26,184
13,864
7,087
6,777
-1
-1
{-# LANGUAGE TemplateHaskell #-} module T16895a where import Language.Haskell.TH main = print $(uInfixE [|1|] [|id id|] [|2|])
sdiehl/ghc
testsuite/tests/th/T16895a.hs
bsd-3-clause
130
0
8
20
39
26
13
4
1
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE OverloadedStrings #-} module Reporting.Error where import Data.Aeson ((.=)) import qualified Data.Aeson as Json import Prelude hiding (print) import qualified Reporting.Annotation as A import qualified Reporting.Error.Canonicalize as Canonicalize import qualified Reporting.Error...
johnpmayer/elm-compiler
src/Reporting/Error.hs
bsd-3-clause
2,485
0
20
635
638
341
297
59
4
{-# OPTIONS_GHC -fwarn-unused-imports -fno-warn-missing-methods #-} -- Check that although 'index' is apparently only used -- unqualified, we nevertheless do not get a redundant-import warning -- #3776 module T3776 where import qualified Data.Ix( Ix(index) ) instance Data.Ix.Ix Float where index = error "urk"
sdiehl/ghc
testsuite/tests/module/T3776.hs
bsd-3-clause
319
0
6
50
42
27
15
5
0
module HAD.Y2014.M03.D20.Exercise where -- | addNoise -- add "noise" to a list of number: each number is modified by a -- random value between -x and x (where x is one of the parameter of the -- function. -- -- Quite easy -- I didn't try it pointfree -- I didn't try to find a one-liner -- -- The function signature fol...
1HaskellADay/1HAD
exercises/HAD/Y2014/M03/D20/Exercise.hs
mit
574
0
10
109
71
48
23
3
1
{-# LANGUAGE MultiParamTypeClasses, TypeFamilies, GADTs, ConstraintKinds, DataKinds, KindSignatures, FlexibleInstances #-} {-# OPTIONS -fno-warn-redundant-constraints #-} module T10195 where import GHC.Exts data Foo m zp r'q = Foo zp data Dict :: Constraint -> * where Dict :: a => Dict a ...
urbanslug/ghc
testsuite/tests/typecheck/should_compile/T10195.hs
bsd-3-clause
764
0
11
191
293
152
141
-1
-1
{-# LANGUAGE TupleSections, FlexibleContexts #-} module Kachushi.Decision ( chooseFirstFive , chooseOne ) where import Grabble.Grabble import Kachushi.Cards (Card (..)) import Kachushi.OFCP (Board (..), FilledBoard (..), Row (..), Slot (..), toBoard, scoreGame) import Kachushi.KState (KState (..), boards, dec...
ScrambledEggsOnToast/Kachushi
Kachushi/Decision.hs
mit
4,621
0
23
1,416
1,906
1,017
889
90
4
import Text.Regex.PCRE import Data.List import System.Environment main :: IO () main = do input <- getContents args <- getArgs let pass = args !! 0 putStrLn . unscramble pass . reverse . lines $ input unscramble pass [] = pass unscramble pass (l : ls) = unscramble pass' ls where action = head [ a | (p,...
lzlarryli/advent_of_code_2016
day21/part2.hs
mit
3,225
6
14
1,274
1,375
737
638
82
3
{-# LANGUAGE OverloadedStrings #-} module Cric.UsersSpec ( test ) where import Test.Hspec import SpecHelpers import Data.List import Cric import Cric.Users test :: Spec test = do describe "createUser" $ do it "builds the command with different parameters" $ do let opts = defaultUserOptions ...
thoferon/cric
tests/Cric/UsersSpec.hs
mit
2,502
0
21
995
596
313
283
58
4
{-# OPTIONS_GHC -Wall #-} module FailureExercise where import Test.QuickCheck -- Failure -- Find out why this property fails. -- for a function square x = x * x -- why does this property no hold? Examine the type of sqrt. squareIdentity = square . sqrt prop_squareIdentity :: (Floating a, Eq a) => a -> Bool prop_squ...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter14.hsproj/FailureExercise.hs
mit
358
0
6
66
74
42
32
7
1
module DataTypes where import Data.Foldable hiding (msum) import Data.Map (Map) import Data.Monoid import Control.Monad.State import Data.Traversable import Data.Functor import Control.Applicative type Modality = String data Type = TAtomic String | TMonadic Modality Type | TPair Type Type ...
gianlucagiorgolo/glue-tp
DataTypes.hs
mit
4,740
0
10
1,313
1,944
1,011
933
112
1
{-# LANGUAGE TupleSections, ViewPatterns #-} module Y2018.M05.D04.Solution where {-- We're going to ease back into ETL-like functionality again. The endgame is this: We want to create a daily upload process that: 1. Queries the database for the most recent entry into the audit logs (date) 2. Fetches a set of (articl...
geophf/1HaskellADay
exercises/HAD/Y2018/M05/D04/Solution.hs
mit
5,127
0
18
1,056
1,124
608
516
70
3
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module System.TrailDB.Error ( TrailDBException(..) ) where import Control.Exception import Data.Data import Foreign.C.Types import GHC.Generics -- | Exceptions that may happen with TrailDBs. -- -- Some programming errors may throw with `error` in...
traildb/traildb-haskell
System/TrailDB/Error.hs
mit
1,296
0
7
327
122
78
44
22
0
module Prepare.Perseus.TeiEpidocParser where import Prelude hiding (Word) import Control.Lens (over, _Just) import Data.Text (Text) import qualified Data.Text as Text import Prepare.Perseus.TeiEpidocModel import qualified Prepare.Perseus.TeiEpidocHeaderParser as Header import Prepare.Perseus.TeiEpidocParserCommon impo...
ancientlanguage/haskell-analysis
prepare/src/Prepare/Perseus/TeiEpidocParser.hs
mit
7,770
0
17
1,442
2,736
1,385
1,351
206
1
module Shapes.Linear.Class where -- TODO: use class to make matrix/vector/scalar multiplication fit together nicely? -- NOTE: Can't make type family of kind #. (confirm?)
ublubu/shapes
shapes-math/src/Shapes/Linear/Class.hs
mit
172
0
3
25
9
7
2
1
0
module DynamoDbEventStore.ProjectPrelude (traceM ,module X ,NonEmpty(..) ,fmap2 ,Foldable.traverse_ ) where import BasicPrelude as X import GHC.Natural as X import Control.Monad.Except as X import Pipes as X (Producer, yield, await, (>->), Pipe) import Data.List.NonEmpty (NonEmpty(..)) import Data.Foldable...
adbrowne/dynamodb-eventstore
dynamodb-eventstore/src/DynamoDbEventStore/ProjectPrelude.hs
mit
605
0
10
114
209
128
81
21
1
module Network.Levin.Command.Ping where import Network.Levin.Peer (PeerId) -- net_node.h -- p2p_protocol_defs.h -- Used to make "callback" connection, to be sure that opponent node -- have accessible connection point. Only other nodes can add peer to peerlist, -- and ONLY in case when peer has accepted connection ...
nvmd/hs-cryptonote
src/Network/Levin/Command/Ping.hs
mit
638
0
8
177
61
41
20
7
0
{-# OPTIONS_HADDOCK hide, prune #-} module Handler.About ( getAboutR ) where import Import getAboutR :: Handler Html getAboutR = fullLayout Nothing "About us" $ do setTitle "About qua-kit" toWidgetBody $ [hamlet| <div class="row"> <div class="col-lg-6 col-md-5 col-sm...
mb21/qua-kit
apps/hs/qua-server/src/Handler/About.hs
mit
5,757
0
8
2,339
54
30
24
-1
-1
module Example1 ( main ) where import Data.List (intercalate) import Control.Arrow ((&&&)) import LogicProblem -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- data ID = A | B | C | D | E deriving (Show, Eq, Ord, Enum, Bounded) data Color = Roja | Verde | Azul ...
fehu/h-logic-einstein
example-1/Example1.hs
mit
6,625
0
14
2,647
1,552
812
740
-1
-1
module Internal.API where import Internal.FFI import Internal.Type import Data.JSString.Text (textFromJSString, textToJSString) import GHCJS.Marshal (FromJSVal (..)) import GHCJS.Perch (Elem) import Control.Arrow ((***)) import Da...
geraldus/ghcjs-perch-canvas
src/Internal/API.hs
mit
6,332
0
14
1,500
1,388
725
663
109
3
module Service.Interface ( get_server_info, get_task_types, get_task_description, verify_task_config, get_task_instance, get_task_instance_or_fail, grade_task_solution, get_task_description_localized, verify_task_config_localized, get_task_instance_localized, grade_task_sol...
marcellussiegburg/autotool
server-interface/src/Service/Interface.hs
gpl-2.0
3,345
0
14
575
1,029
540
489
80
1
{-# OPTIONS_HADDOCK ignore-exports #-} {-# LANGUAGE ViewPatterns #-} module Algebra.Vector where import Control.Applicative import Control.Arrow ((***)) import Data.List (sortBy) import Diagrams.Coordinates import Diagrams.TwoD.Types import GHC.Float import MyPrelude data Alignment = CW | CCW ...
hasufell/CGA
Algebra/Vector.hs
gpl-2.0
7,367
0
14
2,195
2,099
1,126
973
138
3
{-| Implementation of command-line functions. This module holds the common command-line related functions for the binaries, separated into this module since "Ganeti.Utils" is used in many other places and this is more IO oriented. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. This program is free so...
narurien/ganeti-ceph
src/Ganeti/HTools/CLI.hs
gpl-2.0
24,674
0
21
6,358
5,201
2,940
2,261
591
3
{-# LANGUAGE DeriveDataTypeable, RecordWildCards #-} module Tasks.Cli.Cli( -- ) where import Data.Binary import qualified Data.ByteString as B import Data.Maybe import System.Console.CmdArgs import Tasks.Project import Tasks.Types import Tasks.Cli.Types (>>>) :: a -> (a -> b) -> b val >>> f = f val dbPath :...
BigEndian/tasks
tasks-cli/Tasks/Cli/Cli.hs
gpl-2.0
2,260
0
15
577
701
375
326
51
2
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeSynonymInstances #-} module Language.ArrayForth.HLL.AST where import Prelude hiding (Ord (..), Eq (..), not) import qualified Prelude impor...
TikhonJelvis/array-forth-hll
src/Language/ArrayForth/HLL/AST.hs
gpl-3.0
2,510
24
14
741
991
573
418
75
1
{-# LANGUAGE OverloadedStrings , ConstraintKinds , FlexibleContexts , MultiParamTypeClasses , DeriveGeneric , GeneralizedNewtypeDeriving #-} module Application.Types where import Cabal.Types import Server.Types import Schema import Path.Extended import qualified Data.Text as T import qualified Data.T...
athanclark/happ-store
src/Application/Types.hs
gpl-3.0
7,828
0
18
2,147
1,838
977
861
183
1
-- Data.Fasta.ByteString.Lazy module. -- By G.W. Schwartz -- {- | Collects all application specific functions and types. Used here for Text.Lazy -} module Data.Fasta.ByteString.Lazy ( module Data.Fasta.ByteString.Lazy.Types , module Data.Fasta.ByteString.Lazy.Parse ...
GregorySchwartz/fasta
src/Data/Fasta/ByteString/Lazy.hs
gpl-3.0
647
0
5
152
83
64
19
8
0
{- Author: Ary Pablo Batista <arypbatista@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
arypbatista/LIS-Parser
LISRepresentation.hs
gpl-3.0
3,512
0
8
1,374
956
527
429
-1
-1
-- Examples from -- http://www.csc.liv.ac.uk/~lad/research/challenges module IWC where import Hip.Prelude hiding (choose) import Prelude(Bool(..)) data Nat = S Nat | Z otherwise = True len [] = Z len (x:xs) = S (len xs) even Z = True even (S Z) = False even (S (S x)) = even x [] `app` ys = ys (x:xs) `app` ys...
danr/hipspec
examples/old-examples/hip/IWC.hs
gpl-3.0
2,607
0
17
808
1,498
774
724
66
1
{- The data structures used for NFA-DFA conversion. This was created as Project 1 for EECS 665 at the University of Kansas. Author: Ryan Scott -} {-# LANGUAGE RankNTypes #-} module NFA2DFA.Data where import Control.Applicative import Control.Monad import qualified Data.Map as M import D...
RyanGlScott/nfa2dfa
src/NFA2DFA/Data.hs
gpl-3.0
4,995
0
20
1,259
1,238
650
588
107
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-manufacturers/gen/Network/Google/Resource/Manufacturers/Accounts/Products/Delete.hs
mpl-2.0
5,488
0
17
1,203
781
458
323
111
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} module Main where -- aeson -----------------...
duairc/events-fetcher
events-fetcher.hs
agpl-3.0
28,303
0
26
9,442
6,154
3,196
2,958
-1
-1
{-# LANGUAGE DeriveDataTypeable, LambdaCase #-} module ViperVM.VirtualPlatform.MetaObject ( MetaObject(..), allInstances, allocate, attachInstance, detachInstance, exchangeInstance, instanceMemories, instancesInMemory, allocateInstance ) where import ViperVM.VirtualPlatform.Object import ViperVM.VirtualPlatf...
hsyl20/HViperVM
lib/ViperVM/VirtualPlatform/MetaObject.hs
lgpl-3.0
3,388
0
14
608
854
449
405
63
2
-- prmRng 5 11 -> [5,7,11] module Pr39 where import Pr31 prmRng :: Int -> Int -> [Int] prmRng x y = if y <= x then [] else [z | z <- [x..y], isprime z]
ekalosak/haskell-practice
Pr39.hs
lgpl-3.0
170
0
9
54
71
40
31
6
2
{- Why Functional Programming Matters John Hughes, Mary Sheeran (Lambda Days 2017) -} {-# LANGUAGE RankNTypes #-} module Church where -- Booleans true x y = x false x y = y ifte bool t e = bool t e -- Positive integers zero f x = x one f x = f x two f x = f (f x) add m n f x = m f (n f x) mul m n f x = m...
jmgimeno/haskell-playground
src/Church.hs
unlicense
735
0
11
245
407
209
198
28
1
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings, UnicodeSyntax, DeriveGeneric #-} module Sweetroll.Microsub.Response where import Sweetroll.Prelude data Channel = Channel { uid ∷ Text , name ∷ Text , unread ∷ Int } deriving (Generic) i...
myfreeweb/sweetroll
sweetroll-be/library/Sweetroll/Microsub/Response.hs
unlicense
1,778
0
11
485
523
269
254
38
1
module Opts ( parseActions ) where import Control.Error import Options.Applicative import Types parseActions :: Script Actions parseActions = scriptIO $ execParser actions actions :: ParserInfo Actions actions = info (helper <*> actions') ( fullDesc <> p...
erochest/topical
app/Opts.hs
apache-2.0
1,265
0
14
483
254
125
129
27
1
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Tests for lock allocation. -} {- Copyright (C) 2014 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistri...
ganeti-github-testing/ganeti-test-1
test/hs/Test/Ganeti/Locking/Allocation.hs
bsd-2-clause
14,937
0
27
3,125
3,390
1,815
1,575
231
2
-- | This module contains some useful combinators I have come across as I built a large -- react-flux application. None of these are required to use React.Flux, they just reduce somewhat -- the typing needed to create rendering functions. module React.Flux.Combinators ( clbutton_ , cldiv_ , faIcon_ , foreign...
nrolland/react-flux
src/React/Flux/Combinators.hs
bsd-3-clause
5,203
7
10
1,164
455
280
175
32
1
module Problem112 where import Data.Function main :: IO () main = print . snd . head . dropWhile ((< 0.99) . uncurry ((/) `on` fromIntegral)) . scanl (\(bouncy, total) num -> if isBouncy num then (bouncy + 1, total + 1) else (bouncy, total + 1) ...
adityagupta1089/Project-Euler-Haskell
src/problems/Problem112.hs
bsd-3-clause
576
0
13
205
241
132
109
18
2
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE OverloadedStrings #-} module Stanag.EoIrConfigurationState where import Ivory.Language import Stanag.Packing import Util.Logger eoIrConfigurationStateInstance :: MemArea (Stored Uint3...
GaloisInc/loi
Stanag/EoIrConfigurationState.hs
bsd-3-clause
460
0
9
46
69
41
28
12
1
-- | Media data box module Data.ByteString.IsoBaseFileFormat.Boxes.MediaData where import qualified Data.ByteString as B import Data.ByteString.IsoBaseFileFormat.Box import Data.ByteString.IsoBaseFileFormat.Util.BoxContent -- | Media data box phantom type newtype MediaData = MediaData B.ByteString deriving (Show, I...
sheyll/isobmff-builder
src/Data/ByteString/IsoBaseFileFormat/Boxes/MediaData.hs
bsd-3-clause
566
0
6
74
100
63
37
-1
-1
{-# LANGUAGE FlexibleContexts, RankNTypes, RecordWildCards #-} module Cloud.AWS.CloudWatch.Metric ( listMetrics , getMetricStatistics , putMetricData ) where import Data.Text (Text) import Data.Time (UTCTime) import Control.Applicative import Control.Monad.Trans.Resource (MonadThrow, MonadResource, Mo...
worksap-ate/aws-sdk
Cloud/AWS/CloudWatch/Metric.hs
bsd-3-clause
3,778
0
26
938
925
512
413
99
1
{-# LANGUAGE Rank2Types, ExistentialQuantification #-} module Data.Aeson.Error.JsonError where import Data.Aeson.Types (Value, ToJSON, toJSON, (.=), object ) import qualified Data.Text as StrictText import qualified Data.Text.Lazy as LazyText import qualified Data.Text.Encoding as ...
necrobious/aeson-descriptive-errors
src/Data/Aeson/Error/JsonError.hs
bsd-3-clause
1,700
0
16
384
273
171
102
18
0
-- Skip Chp10 - Functionally Solving Problems {-- Functor Many times the box analogy is used to help you get some intuition for how functors work, and later, we'll probably use the same analogy for applicative functors and monads. A more correct term for what a functor is would be "computational context". The contex...
jamesyang124/haskell-playground
src/Chp110.hs
bsd-3-clause
14,141
0
9
2,867
147
84
63
9
1
{-| Module : Idris.Elab.Term Description : Code to elaborate terms. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE LambdaCase, PatternGuards, ViewPatterns #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Idris.Elab.Term where import Idris.AbsSyntax import Idris.AbsSyn...
FranklinChen/Idris-dev
src/Idris/Elab/Term.hs
bsd-3-clause
130,616
1,309
29
56,381
25,722
14,944
10,778
2,315
249
module Main where import Language.TECS.Jack.ToDeck.Layout import Language.TECS.Jack.ToDeck.Compile import Language.TECS.Jack.Parser import System.Environment (getArgs) import System.FilePath (replaceExtension) import System.IO (hPutStrLn, stderr, withFile, IOMode(..)) import qualified Data.ByteString.Lazy as BS (rea...
gergoerdi/tecs
src/Language/TECS/Jack/jackc.hs
bsd-3-clause
1,036
0
21
240
281
152
129
29
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} module V1.Projects.Actions.Create (Api, server) where import Data.Aeson import Servant import Project (ProjectCreateParams(ProjectCreateParams), createProject) import LibUtils (libToServant) import V1.Projects.Schema (Respon...
thiagorp/deployments-web
app/v1/projects/actions/Create.hs
bsd-3-clause
851
0
9
143
216
124
92
22
1
----------------------------------------------------------------------------- -- | -- Module : Database.TxtSushi.ExternalSort -- Copyright : (c) Keith Sheppard 2009-2010 -- License : BSD3 -- Maintainer : keithshep@gmail.com -- Stability : experimental -- Portability : portable -- -- For sorting huge...
keithshep/txt-sushi
Database/TxtSushi/ExternalSort.hs
bsd-3-clause
7,173
0
12
1,336
1,670
883
787
105
2
module LLVMPrim where import LLVM import LLVMKindle genPrimitives = do -- primitive struct definitions found in rts (name [(fieldname,fieldtype)]) addStruct "LIST" [("GCINFO",poly)] addStruct "CONS" [("GCINFO",poly), ("a", poly), ("b", liststruct)] addStruct "TUP2" ...
mattias-lundell/timber-llvm
src/LLVMPrim.hs
bsd-3-clause
6,346
0
13
1,874
1,885
990
895
131
1
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Network.PeyoTLS.Ecdsa (blSign, makeKs, ecdsaPubKey) where import Control.Applicative ((<$>), (<*>)) import Data.Maybe (mapMaybe) import Data.Bits (shiftR, xor) import Crypto.Number.ModArithmetic (inverse) import qualified Data.ByteString...
YoshikuniJujo/peyotls
peyotls/src/Network/PeyoTLS/Ecdsa.hs
bsd-3-clause
4,664
33
17
941
2,100
1,112
988
109
5
{-# LANGUAGE CPP, GADTs #-} {-# OPTIONS_GHC -Wall -fwarn-tabs #-} ---------------------------------------------------------------- -- 2015.12.19 -- | -- Module : Language.Hakaru.Syntax.AST.Sing -- Copyright : Copyright (c) 2016 the Hakaru team -- License ...
zaxtax/hakaru
haskell/Language/Hakaru/Syntax/AST/Sing.hs
bsd-3-clause
5,509
0
11
1,203
1,552
892
660
93
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} -- | -- Module: Data.Stencil.Types -- Copyright: Tobias Florek 2014 -- License: BSD3 -- -- Maintainer: Tobias Florek <tob@butter.sh> -- Stability: experimental -- Portability: unknown -- -- Base typ...
ibotty/stencil
src/Text/Stencil/Types.hs
bsd-3-clause
6,213
0
11
1,685
1,885
1,025
860
143
3
{-# LANGUAGE TemplateHaskell, QuasiQuotes #-} {- | A grab bag of useful instances for Template Haskell types -} module Language.Haskell.TH.LiftInstances where import qualified Language.Haskell.TH.Lift as L import Language.Haskell.TH import Language.Haskell.TH.Syntax --import Language.Haskell.TH.LambdaConvert impor...
jfischoff/th-instances
src/Language/Haskell/TH/LiftInstances.hs
bsd-3-clause
1,609
0
9
451
490
263
227
33
1
{-# LANGUAGE ScopedTypeVariables #-} module Ivory.Language.BoundedInteger where import Text.Printf import Ivory.Language.Proxy import qualified Ivory.Language.Syntax as I import Ivory.Language.Type -------------------------------------------------------------------------------- -- | I...
GaloisInc/ivory
ivory/src/Ivory/Language/BoundedInteger.hs
bsd-3-clause
952
0
10
215
243
132
111
19
1