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 TemplateHaskell, OverloadedStrings #-} module Model.AssetSlot.SQL ( slotAssetRow , makeSlotAsset , selectContainerSlotAsset -- , selectOrigContainerSlotAsset , selectAssetSlotAsset , selectVolumeSlotAsset , selectVolumeSlotIdAsset -- , selectSlotAsset , selectAssetSlot -- , insertSlotAs...
databrary/databrary
src/Model/AssetSlot/SQL.hs
agpl-3.0
4,909
0
9
779
691
390
301
70
1
module Data.Tree.Diff ( Difference(..) , treeDifference ) where import Data.List import Data.Tree import Data.Function import Data.Maybe import Control.Applicative equalRoots :: (Eq a) => Tree a -> Tree a -> Bool equalRoots = (==) `on` rootLabel data Difference a = First a | Second a | Both a deriving...
JanBessai/dirdiff
src/Data/Tree/Diff.hs
lgpl-3.0
1,265
0
15
352
541
276
265
35
2
-- | -- Module : Water.SWMM -- Copyright : (C) 2014 Siddhanathan Shanmugam -- License : LGPL (see LICENSE) -- Maintainer : siddhanathan@gmail.com -- Portability : very -- -- Parser for SWMM 5 Binary .OUT files -- {-# LANGUAGE Trustworthy #-} module Water.SWMM ( SWMMObject(..) , Header(..) ...
Acidburn0zzz/SWMMoutGetMB
src/Water/SWMM.hs
lgpl-3.0
9,928
8
14
3,938
1,854
1,026
828
175
1
{-# LANGUAGE QuasiQuotes , RecordWildCards #-} module QR.BathroomStallsSpec where import Test.Hspec import Data.Maybe import Data.Set import QR.TripletSort spec :: Spec spec = do describe "test getSleepNumber" $ do it "test getBathroomStalls" $ fmap getResult [["5","5 6 8 4 3"],["3", "8 9 7"]]...
lihlcnkr/codejam
test/QR/BathroomStallsSpec.hs
apache-2.0
347
0
14
70
98
57
41
12
1
{-# LANGUAGE ScopedTypeVariables #-} module Handler.Global where import Import menu :: Route Hermes -> Widget menu current = [whamlet| <ul> <li> ^{createLink PostsR current "Posts"} <li> ^{createLink (SPageR "idea") current "Idea"} <li> ^{createLink (SPa...
kostas1/Hermes
Handler/Global.hs
bsd-2-clause
4,692
0
17
1,475
736
375
361
-1
-1
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} module Main where import Util import System.Exit ( exitFailure, exitSuccess ) import Test.HUnit testTakeUntil = "takeUntil" ~: [ takeUntil (> 1) [] ~=? [], takeUntil (> 1) [2] ~=? [2]] main = do cnt <- runTestTT...
guillaume-nargeot/hpc-coveralls-testing-sandbox
test/Test.hs
bsd-3-clause
430
0
10
94
124
69
55
14
2
{-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# ...
GaloisInc/saw-script
heapster-saw/src/Verifier/SAW/Heapster/Permissions.hs
bsd-3-clause
349,676
6,114
128
75,992
83,972
44,405
39,567
-1
-1
{-# LANGUAGE DeriveGeneric, FlexibleInstances, StandaloneDeriving #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Kraken.Web.TargetGraph where import Control.Applicative import Data.Aeson import Data.Graph.Wrapper import GHC.Generics import Kraken.ActionM import ...
zalora/kraken
src/Kraken/Web/TargetGraph.hs
bsd-3-clause
1,015
0
10
196
235
124
111
27
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ParallelListComp #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ViewPatterns #-} ----------------------------------------------------------------------------- -...
xmonad/xmonad-contrib
XMonad/Layout/SubLayouts.hs
bsd-3-clause
21,855
35
23
5,729
5,317
2,841
2,476
259
1
-- Copyright (c) 2017 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/Common/Alloc.hs
bsd-3-clause
6,374
2
14
1,609
1,360
755
605
107
2
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE OverloadedStrings #-} module Serv.Server.Core.Config.ServerData ( ServerConfig(..) , defaultConfig ) where import Control.Exception import Data.Aeson ...
orangefiredragon/bear
src/Serv/Server/Core/Config/ServerConfigData.hs
bsd-3-clause
2,907
0
15
984
628
367
261
64
1
{-# LANGUAGE DeriveDataTypeable #-} module Coordinate where import Data.Data import Data.Typeable data Coordinates = Coordinates { x :: Float, y :: Float } deriving (Data, Typeable, Show)
timorantalaiho/pong11
src/Coordinate.hs
bsd-3-clause
190
0
8
29
51
31
20
5
0
module Graphics.OpenGL.Basic ( module Graphics.OpenGL.Types , Scope , HasScope(..) , OpenGL , GLLoader -- * OpenGL Initialization , initGL -- * Convenience Functions , runGL , ifM , unlessM ) where import Control.Applicative import Control.Monad import Control.Monad.Trans import Foreign.C.String import...
polarina/opengl-wrangler
Graphics/OpenGL/Basic.hs
bsd-3-clause
1,275
2
9
255
282
159
123
25
1
-- | -- Module: Control.Wire.Event -- Copyright: (c) 2013 Ertugrul Soeylemez -- License: BSD3 -- Maintainer: Ertugrul Soeylemez <es@ertes.de> module Control.Wire.Event ( -- * Events EventLike(toEvent), Event, UniqueEvent, -- * Time-based at, never, now, peri...
abbradar/netwire
Control/Wire/Event.hs
bsd-3-clause
9,267
0
17
2,612
3,003
1,628
1,375
-1
-1
----------------------------------------------------------------------------- -- -- Module : MFlow.Hack.XHtml.All -- Copyright : -- License : BSD3 -- -- Maintainer : agocorona@gmail.com -- Stability : experimental -- Portability : -- -- | -- ------------------------------------------------------------...
agocorona/MFlow
src/MFlow/Hack/XHtml/All.hs
bsd-3-clause
975
0
5
114
174
121
53
25
0
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} module Unique where import Data.Serialize import GHC.Generics class HasUnique a where type Unique a :: * unique :: a -> Unique a class HasUnique a => UnUnique a where ununique :: Unique a -> ...
showpoint/refs
src/Unique.hs
bsd-3-clause
322
0
8
69
73
40
33
11
0
module Evaluation where import Syntax data Result = Bool Bool | Num Int | Neither deriving Show class NB x => Evaluate x where eval :: x -> Result instance Evaluate TrueB where eval TrueB = Bool True instance Evaluate FalseB where eval FalseB = Bool False instance (Evaluate c, Evaluate t, Evaluate e) => Eva...
grammarware/slps
topics/implementation/nb/expression/Evaluation.hs
bsd-3-clause
862
4
11
203
425
214
211
31
0
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-} module Purescript.Ide.Command (parseCommand, Command(..), Level(..)) where import Data.Text (Text) import qualified Data.Text as T import Text.Parsec import Text.Parsec.Text data Level = File | Project | Pursui...
passy/psc-ide
lib/Purescript/Ide/Command.hs
bsd-3-clause
1,696
0
14
414
530
264
266
62
1
import Disorder.Core.Main import qualified Test.Mismi.Autoscaling.Data main :: IO () main = disorderMain [ Test.Mismi.Autoscaling.Data.tests ]
ambiata/mismi
mismi-autoscaling/test/test.hs
bsd-3-clause
167
0
7
39
41
25
16
6
1
module Arhelk.Russian.Lemma.Particle( particle ) where import Arhelk.Core.Rule import Arhelk.Russian.Lemma.Common import Arhelk.Russian.Lemma.Data import Control.Arrow (first) import Control.Monad import Data.List (nub, nubBy) import Data.Maybe import Data.Text as T import Prelude as P hiding (Word) import qua...
Teaspot-Studio/arhelk-russian
src/Arhelk/Russian/Lemma/Particle.hs
bsd-3-clause
2,397
0
19
485
803
450
353
47
9
module MyMain ( module Data.Char -- , module Control.Arrow , module Diagrams.Prelude , module Diagrams.Backend.Cairo , module Diagrams.TwoD.Path.Turtle) where -- import Control.Arrow import Data.Char import Diagrams.Prelude import Diagrams.Backend.Cairo import Diagrams.TwoD.Path.Turtle import Prelude main ...
mgsloan/panopti
MyMain.hs
bsd-3-clause
335
0
6
51
74
49
25
11
1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple -- Copyright : Isaac Jones 2003-2005 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This is the command line front end to the Simple build sys...
sopvop/cabal
Cabal/Distribution/Simple.hs
bsd-3-clause
31,265
0
18
8,003
6,212
3,154
3,058
507
8
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeSy...
UCSD-PL/RefScript
src/Language/Rsc/TypeUtilities.hs
bsd-3-clause
9,545
0
16
2,542
2,333
1,248
1,085
110
6
module Ex11 where import Data.Vector (Vector) import qualified Data.Vector as V import Cards nextCard :: Deck -> Maybe (Card, Deck) nextCard d | V.length d == 0 = Nothing | otherwise = return (V.head d, V.tail d)
bobbyrauchenberg/haskellCourse
src/Ex11.hs
bsd-3-clause
228
0
10
52
94
50
44
8
1
{-# LANGUAGE OverloadedStrings #-} -- | High-level access to TradeKing APIs module Finance.TradeKing.Quotes (stockQuotes, stockInfos, streamQuotes) where import Finance.TradeKing.Types import Finance.TradeKing.Service (invokeSimple, streamQuotes') import qualified Control.Exception.Lifted as E import Control.Applicat...
tathougies/hstradeking
src/Finance/TradeKing/Quotes.hs
bsd-3-clause
9,994
0
32
3,257
2,852
1,477
1,375
183
4
{-# OPTIONS -fno-warn-name-shadowing #-} {-# LANGUAGE NoMonoLocalBinds #-} {-# LANGUAGE TypeFamilies #-} module Language.Haskell.Names.Exports ( processExports ) where import Fay.Compiler.ModuleT import Language.Haskell.Names.GlobalSymbolTable as Global import Language.Haskell.Nam...
beni55/fay
src/haskell-names/Language/Haskell/Names/Exports.hs
bsd-3-clause
4,797
0
23
1,679
1,449
741
708
122
14
module VisibilityTest where import Test.Framework (buildTest, defaultMain, testGroup) import Test.Framework.Providers.HUnit import Test.HUnit import Geometry import Visibility main = defaultMain tests tests = [testCalculateEndpoints, testSweep] testCalculateEndpoints = testGroup "calculateEndpoints" [ testCase "...
nullobject/flatland-haskell
test/VisibilityTest.hs
bsd-3-clause
2,162
0
13
694
1,062
617
445
47
1
{-# LANGUAGE TypeOperators #-} -- | -- Module : Data.Binding.Hobbits -- Copyright : (c) 2011 Edwin Westbrook, Nicolas Frisby, and Paul Brauner -- -- License : BSD3 -- -- Maintainer : emw4@rice.edu -- Stability : experimental -- Portability : GHC -- -- This library implements multi-bindings as described i...
eddywestbrook/hobbits
src/Data/Binding/Hobbits.hs
bsd-3-clause
2,074
0
6
333
233
176
57
18
0
{-# LANGUAGE DeriveGeneric #-} module Configuration where import qualified Data.Text as T import Data.Yaml import GHC.Generics import System.FilePath () data Configuration = Configuration { n4jHost :: T.Text , n4jPort :: Int , n4jUser :: T.Text , n4jPass :: T.Text } deriving (Eq, Generic, Show) ...
vulgr/vulgr
src/Configuration.hs
bsd-3-clause
466
0
9
85
123
71
52
15
1
{-# LANGUAGE CPP, MagicHash, RecordWildCards #-} -- -- (c) The University of Glasgow 2002-2006 -- -- | ByteCodeGen: Generate bytecode from Core module ByteCodeGen ( UnlinkedBCO, byteCodeGen, coreExprToBCOs ) where #include "HsVersions.h" import ByteCodeInstr import ByteCodeAsm import ByteCodeTypes import GHCi impo...
vTurbine/ghc
compiler/ghci/ByteCodeGen.hs
bsd-3-clause
67,969
0
23
21,488
14,988
7,682
7,306
-1
-1
module StringCompressorKata.Day8Spec (spec) where import Test.Hspec import StringCompressorKata.Day8 (compress) spec :: Spec spec = do it "compresses nothing to nothing" $ do compress Nothing `shouldBe` Nothing it "compresses an empty string to another empty string" $ do ...
Alex-Diez/haskell-tdd-kata
old-katas/test/StringCompressorKata/Day8Spec.hs
bsd-3-clause
720
0
13
209
182
88
94
15
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-} -- | <http://www.libtorrent.org/reference-Core.html#dht_settings dht_settings> for "Libtorrent" module Network.Libtorrent.Session.DhtSettings (D...
eryx67/haskell-libtorrent
src/Network/Libtorrent/Session/DhtSettings.hs
bsd-3-clause
8,688
0
12
2,527
1,894
1,016
878
172
1
{-# LANGUAGE DeriveGeneric #-} module Actions where import Control.Applicative import Control.Category import Control.Lens import Control.Monad.Reader as Reader import Data.Maybe (fromJust, isJust, isNothing, listToMaybe) import Debug.Trace import Debug.Trace.Helpers import GHC.Generics import Prelude hiding (Either(...
fros1y/umbral
src/Actions.hs
bsd-3-clause
2,092
0
17
387
638
340
298
57
2
module TestType where data TestType = TestType Int data PolyType a = PolyType a data TestTypeInt = TestTypeInt (PolyType Int) type IntList = [Int] data ListLike = ListLike { values :: IntList } deriving(Show, Eq)
jfischoff/specialize-th
tests/TestType.hs
bsd-3-clause
241
0
8
63
73
43
30
8
0
----------------------------------------------------------------------------- -- | -- Module : Generics.Pointless.Bifctrable -- Copyright : (c) 2009 University of Minho -- License : BSD3 -- -- Maintainer : hpacheco@di.uminho.pt -- Stability : experimental -- Portability : non-portable -- -- Pointles...
d-day/relation
include/pointfree-style/pointless-haskell-0.0.8/src/Generics/Pointless/Bifctrable.hs
bsd-3-clause
1,955
0
10
366
524
290
234
-1
-1
{-# LANGUAGE PatternGuards #-} module Ant.Square ( Square , squareHill , squareAnt , isHill , isAnt , isVisible , wasSeen , isWater , hasFood , isLand , squareChar , charSquare , setVisibility , setContent , waterSquare , landSq...
Saulzar/Ants
Ant/Square.hs
bsd-3-clause
4,808
0
10
1,451
1,299
694
605
127
1
module ValidatedAccSpec (spec) where import Test.Hspec import Data.Validated.Acc import Control.Applicative spec :: Spec spec = do describe "fmap" $ do it "should answer valid for valid" $ do fmap (+1) (Valid 1) `shouldBe` (Valid 2) it "should answer invalid for invalid"...
arquitecturas-concurrentes/iasc-functors-sample-scala
spec/ValidatedAccSpec.hs
mit
1,156
0
17
290
452
233
219
25
1
module Test.Chell.HUnit ( hunit ) where import qualified Test.Chell as Chell import Test.HUnit.Lang (Assertion, performTestCase) -- | Convert a sequence of HUnit assertions (embedded in IO) to a Chell -- 'Chell.Test'. -- -- @ --import Test.Chell --import Test.Chell.HUnit --import Test.HUnit -- --test_Addi...
jmillikin/chell-hunit
lib/Test/Chell/HUnit.hs
mit
791
4
14
153
200
112
88
13
3
<?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>AdvFuzzer Add-On</title> <maps> <homeID>top</homeID> <mapref location="...
veggiespam/zap-extensions
addOns/fuzz/src/main/javahelp/org/zaproxy/zap/extension/fuzz/resources/help_hi_IN/helpset_hi_IN.hs
apache-2.0
962
79
67
157
413
209
204
-1
-1
module Distribution.Server.Features.HaskellPlatform ( PlatformFeature, platformResource, PlatformResource(..), initPlatformFeature, platformVersions, platformPackageLatest, setPlatform, removePlatform ) where import Distribution.Server.Acid (query, update) import Distribution.Server.F...
isomorphism/hackage2
Distribution/Server/Features/HaskellPlatform.hs
bsd-3-clause
2,867
0
17
478
629
357
272
48
1
module IRTS.BCImp where -- Bytecode for a register/variable based VM (e.g. for generating code in an -- imperative language where we let the language deal with GC) import IRTS.Lang import IRTS.Simplified import Core.TT data Reg = RVal | L Int data BC = NOP toBC :: (Name, SDecl) -> (Name, [BC]) toBC (n, SFun n' ar...
christiaanb/Idris-dev
src/IRTS/BCImp.hs
bsd-3-clause
397
0
7
83
121
71
50
11
1
{-# LANGUAGE CPP #-} -- | Arrays, based on Data.Vector.Unboxed, indexed by @Point@. module Game.LambdaHack.Common.PointArray ( Array , (!), (//), replicateA, replicateMA, generateA, generateMA, sizeA , foldlA, ifoldlA, mapA, imapA, mapWithKeyMA , safeSetA, unsafeSetA, unsafeUpdateA , minIndexA, minLastIndexA,...
Concomitant/LambdaHack
Game/LambdaHack/Common/PointArray.hs
bsd-3-clause
7,423
0
15
1,596
2,466
1,312
1,154
-1
-1
{-# OPTIONS_GHC -fvectorise #-} module Data.Array.Parallel.Prelude.Bool ( Bool(..) , P.otherwise , (P.&&), (P.||), P.not, andP, orP , fromBool, toBool) where -- Primitives needed by the vectoriser. import Data.Array.Parallel.Prim import Data.Array.Parallel.PArr import Data.Array.Paral...
mainland/dph
dph-lifted-vseg/Data/Array/Parallel/Prelude/Bool.hs
bsd-3-clause
3,903
0
18
838
830
473
357
-1
-1
{-# OPTIONS -Wall #-} module Test.Paraiso.Option ( cpp, cuda, fail, help, cppc, cudac, argv, printHelp ) where import Prelude hiding (fail) import System.Environment (getArgs) import System.IO.Unsafe (unsafePerformIO) argv0 :: [String] argv0 = unsafePerformIO $ getArgs myArgvs :: [(String, String)] myArgvs ...
nushio3/Paraiso
Test/Paraiso/Option.hs
bsd-3-clause
1,198
0
12
253
364
210
154
36
1
{-# LANGUAGE FlexibleContexts #-} module Hattis.Text.SourceFile (langs, FileExt, Language, name, verifyfiles, fromStr) where import Control.Arrow import Control.Monad import Data.Char import Data.Either import System.Directory import Hattis.Error import System.FilePath import qualified Data.List as L type Files = [Str...
EmilGedda/hattis
src/Hattis/Text/SourceFile.hs
bsd-3-clause
3,037
0
15
917
1,073
573
500
84
2
module Fib where fib :: Int -- ^ -- >>> 23 -- 23 -> Int fib _ = undefined
snoyberg/doctest-haskell
test/integration/testDocumentationForArguments/Fib.hs
mit
102
0
5
47
24
15
9
4
1
{-# LANGUAGE CPP #-} module Main where import HList import Data.List data Tree a = Node (Tree a) (Tree a) | Leaf a {-# INLINE repR #-} repR :: ([a] -> [a]) -> ([a] -> H a) repR f = repH . f {-# INLINE absR #-} absR :: ([a] -> H a) -> ([a] -> [a]) absR g = absH . g qsort :: Ord a => [a] -> [a] qsort [] = [] qs...
beni55/hermit
examples/qsort/QSort.hs
bsd-2-clause
1,028
0
8
314
290
167
123
-1
-1
module Idris.REPL.Commands where import Idris.AbsSyntaxTree import Idris.Colours import Idris.Core.TT import Idris.Options -- | REPL commands data Command = Quit | Help | Eval PTerm | NewDefn [PDecl] -- ^ Each 'PDecl' should be either a type declaration (at most one) or a clause...
uuhan/Idris-dev
src/Idris/REPL/Commands.hs
bsd-3-clause
2,689
0
8
1,275
448
270
178
75
0
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} module NN.Examples.AlexNet(alexNetSmall, alexNet, main) where import Control.Lens import Control.Monad import NN import NN.Examples.ImageNet alexTrain = train & cropSize' 227 & batchSize' 256 & mirror' True alexTest = test & cro...
sjfloat/dnngraph
NN/Examples/AlexNet.hs
bsd-3-clause
2,126
0
14
504
762
381
381
40
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE Trustworthy #-} ----------------------------------------------------------------------------- -- | -- Modul...
ezyang/ghc
libraries/base/System/Posix/Types.hs
bsd-3-clause
5,158
0
6
704
749
507
242
-1
-1
-- Tests pattern bindings that are generalised module T5032 where id1 :: a -> a (id1) = id foo = (id1 True, id1 'x') g :: a -> a h :: a -> a (g, h) = (\x -> x, \y -> y) too = (g (h True), g (h 'x')) -- No type signature necessary; -- the MR only strikes when overloading is involved [id3] = [id] noo = (id3 True,...
hferreiro/replay
testsuite/tests/typecheck/should_compile/T5032.hs
bsd-3-clause
330
0
8
82
146
83
63
10
1
-- NMEA checksum -- http://www.codewars.com/kata/54249c6bf132dcc661000495/ module NMEA where import Data.Char (isHexDigit) import Numeric (readHex) import Data.Bits (xor) check :: String -> Bool check ('$':xs) | valid = (== (fst . head . readHex $ checksum)) . foldl1 xor . map fromEnum $ str where (str, _:rest) ...
gafiatulin/codewars
src/5 kyu/NMEA.hs
mit
465
0
13
98
179
98
81
10
1
{-# LANGUAGE ViewPatterns #-} {- | Module : Summoner.Tree Copyright : (c) 2017-2022 Kowainik SPDX-License-Identifier : MPL-2.0 Maintainer : Kowainik <xrom.xkov@gmail.com> Stability : Stable Portability : Portable Data type for representing filesyst...
vrom911/hs-init
summoner-cli/src/Summoner/Tree.hs
mit
3,872
0
15
992
970
502
468
-1
-1
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE ScopedTypeVariables #-} -- | To run these tests: -- -- * `cabal repl psc-publish` -- * `:l psc-publish/tests/Test.hs` -- * `test` module Test where import Control.Monad import Control.Applicative import Control...
michaelficarra/purescript
psc-publish/tests/Test.hs
mit
2,178
0
18
413
532
275
257
60
3
-- ------------------------------------------------------------------------------------- -- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved. -- For email, run on linux (perl v5.8.5): -- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0...
cbrghostrider/Hacking
HackerRank/FunctionalProgramming/AdHoc/jumpingBunnies.hs
mit
619
0
12
113
103
54
49
8
1
-- stack runghc --package aeson --package bytestring-0.10.8.1 --package websockets --package conduit-extra --package conduit {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} import Control.Concurrent.Async import Control.Monad import ...
haskellbr/meetups
09-2016/programas-como-linguagens/haskell-web-repl/backend.hs
mit
6,906
0
34
2,913
1,623
808
815
123
10
{-# LANGUAGE RecordWildCards #-} -- NOTE: Due to https://github.com/yesodweb/wai/issues/192, this module should -- not use CPP. module Network.Wai.Middleware.RequestLogger ( -- * Basic stdout logging logStdout , logStdoutDev -- * Create more versions , mkRequestLogger , RequestLoggerSettings...
rgrinberg/wai
wai-extra/Network/Wai/Middleware/RequestLogger.hs
mit
12,549
0
21
3,249
3,034
1,612
1,422
225
11
module Main where import Data.Word import Data.Text.Encoding (encodeUtf8, decodeUtf8) import qualified Data.ByteString import Data.ByteString (ByteString) import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as BSL import Data.Text (Text) import qualified Data.Text as T import qualified Data.Te...
Ralith/hhue
src/Main.hs
mit
11,189
0
24
3,428
3,452
1,771
1,681
-1
-1
module Tables where import qualified Data.Map as M import Template import Text.Printf -- Switch the comments to select the small or big table. --sinTable = [ (x, sin x) | x <- [0.0, 0.1 .. 10.0 ] ] sinTable = [ (x, sin x) | x <- [0.0, 0.5 .. 10.0 ] ] sinMap = M.fromList sinTable sinTree = makeTree sinTable targetFr...
cmears/linear-interpolation-article
Tables.hs
mit
543
0
8
102
187
113
74
14
1
module Parse.Date ( getUnixTimeFromPostHtml ) where import Data.ByteString.Char8 (ByteString, unpack) import Data.Time.Format (formatTime, parseTimeOrError, defaultTimeLocale) import Data.Time.LocalTime (LocalTime, TimeZone, localTimeToUTC) import Text.HTML.TagSoup (innerText, Tag (TagOpen), (~==)) import qual...
JacobLeach/xen-parsing
app/Parse/Date.hs
mit
2,057
0
23
357
599
313
286
36
5
module Raindrops ( convert ) where convert :: Int -> String convert n | null drops = show n | otherwise = drops where divisibleBy d = n `rem` d == 0 drops = concat [ if divisibleBy 3 then "Pling" else "" , if divisibleBy 5 then "Plang" else "" , if divisi...
tfausak/exercism-solutions
haskell/raindrops/Raindrops.hs
mit
363
0
10
137
117
62
55
11
4
{-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE QuasiQuotes, TemplateHaskell, CPP, GADTs, TypeFamilies, OverloadedStrings, FlexibleContexts, EmptyDataDecls, FlexibleInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses #-}...
psibi/persistent
persistent-test/src/DataTypeTest.hs
mit
7,186
0
25
1,832
1,500
793
707
109
1
{-# LANGUAGE OverloadedStrings #-} module ZoomHub.Config.AWS ( Config (..), S3BucketName (..), fromEnv, ) where import Data.Text (Text) import qualified Data.Text as T import qualified Network.AWS as AWS import System.Environment (getEnvironment) newtype S3BucketName = S3BucketName {unS3BucketName :: Tex...
zoomhub/zoomhub
src/ZoomHub/Config/AWS.hs
mit
890
0
13
177
231
134
97
25
1
module Main where import qualified Data.Text.IO as TIO (readFile, putStrLn) import qualified Data.Text as T (words, unwords, append) import Data.MarkovChain (run) import System.Random (newStdGen, randomRIO, mkStdGen) main :: IO () main = do input0 <- TIO.readFile "b_04_06_2015.txt" input1 <- TIO.readFile...
cirquit/Personal-Repository
Haskell/Playground/MarkovChain/text-processing/app/Main.hs
mit
713
0
14
139
245
130
115
17
1
{-# LANGUAGE QuasiQuotes #-} module Ocram.Analysis.CallGraph.Test (tests) where -- imports {{{1 import Data.Maybe (isJust, fromJust) import Ocram.Analysis.CallGraph (call_graph, call_chain, call_order, get_callees, get_callers) import Ocram.Test.Lib (enrich, reduce, enumTestGroup, paste) import Test.Framework (testGro...
copton/ocram
ocram/src/Ocram/Analysis/CallGraph/Test.hs
gpl-2.0
4,848
0
14
1,160
1,309
814
495
70
1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- -- Module : IDE.Utils.ServerConnection -- Copyright : 2007-2011 Juergen Nicklisch-Franken, Hamish Mackenzie -- License : GPL -- -- Maintainer : maintai...
573/leksah
src/IDE/Utils/ServerConnection.hs
gpl-2.0
4,603
0
28
1,358
1,254
638
616
94
4
{- A lewd IRC bot that does useless things. Copyright (C) 2012 Shou This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This progr...
Shou/KawaiiBot-hs
KawaiiBot/Bot.hs
gpl-2.0
60,423
0
31
25,559
16,987
8,625
8,362
1,114
17
{-# LANGUAGE CPP #-} module Darcs.Test.Patch.Properties.Check ( Check(..), checkAPatch ) where import Control.Monad ( liftM ) import Darcs.Test.Patch.Check ( PatchCheck, checkMove, removeDir, createDir, isValid, insertLine, fileEmpty, fileExists, ...
DavidAlphaFox/darcs
harness/Darcs/Test/Patch/Properties/Check.hs
gpl-2.0
3,711
0
18
1,124
1,278
674
604
80
4
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 1.0//EN" "http://java.sun.com/products/javahelp/helpset_1_0.dtd"> <helpset version="1.0"> <!-- title --> <title>Hilfe zum Modul EBNF / Syntaxdiagramme</title> <!-- maps --> <map...
jurkov/j-algo-mod
res/module/ebnf/help/jhelp/ebnf_help.hs
gpl-2.0
1,639
124
90
220
649
324
325
-1
-1
module Cryptography.SystemAlgebra.AbstractSystems.Macro where import Types import Macro.Arrows import Macro.Math import Macro.MetaMacro import Functions.Application.Macro -- | Concrete set of systems syss_ :: Note syss_ = phiu -- | Concrete set of labels labs_ :: N...
NorfairKing/the-notes
src/Cryptography/SystemAlgebra/AbstractSystems/Macro.hs
gpl-2.0
1,573
0
9
418
352
203
149
44
1
elemToTuple :: Element -> (String, String, Int) elemToTuple e = (name e, symbol e, atomicNumber e)
hmemcpy/milewski-ctfp-pdf
src/content/1.6/code/haskell/snippet17.hs
gpl-3.0
98
0
6
15
45
24
21
2
1
-- Math.NumberTheory.Utils {-# LANGUAGE CPP, MagicHash, UnboxedTuples, BangPatterns, FlexibleContexts #-} #include "MachDeps.h" import GHC.Base #if __GLASGOW_HASKELL__ < 705 import GHC.Word -- Word and its constructor moved to GHC.Types #endif import GHC.Integer import GHC.Integer.GMP.Internals import Data.Bits...
anthonybrice/euler94
Daniel/NumberTheory.hs
gpl-3.0
18,874
3
39
5,701
3,483
1,866
1,617
247
4
{-# OPTIONS_GHC -XTypeSynonymInstances -XFlexibleInstances #-} module Folsolver.HasPretty ( HasPretty(..) , module Pretty ) where import qualified Data.Set as Set import Data.Set (Set) import qualified Data.Map as Map import Data.Map (Map) import Text.PrettyPrint.HughesPJ as Pretty class HasPretty a where pret...
traeger/fol-solver
Folsolver/HasPretty.hs
gpl-3.0
931
0
10
165
343
185
158
23
0
{-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | -- Copyright : (c) 2011 Simon Meier -- License : GPL v3 (see LICENSE) -- -- Maintainer : Simon Meier <iridcode@gmail.com> -- Portability : portable -- -- Pretty-printing with support for HTML markup and proper HTML escaping. module Text.PrettyPrint.Html ( -- * ...
ekr/tamarin-prover
lib/utils/src/Text/PrettyPrint/Html.hs
gpl-3.0
7,040
0
13
1,430
1,570
843
727
120
6
module Reducer ( reduceToNormalForm, limitSteps, Strategy (..), normalOrder, applicativeOrder, callByName, callByValue, Passing (..), Context (..), defaultContext, noDefs ) where import Prelude hiding (lookup) import Data.Monoid import LambdaAST import LambdaAST.Pa...
sirius94/lambdai
src/Reducer.hs
gpl-3.0
2,759
0
13
907
797
421
376
72
2
module HFlint.NMod ( NMod(..) , ReifiesNModContext , withNModContext , withNModContextM , FlintLimb , HasLimbHeight(..) , ToNMod(..) , ToNModMay(..) , Modulus(..) , modulus , modulusIntegral , ChineseRemainder(..) ) where import HFlint.NMod.FFI import HFlint.NMod.Algebra () import HFli...
martinra/hflint
src/HFlint/NMod.hs
gpl-3.0
533
0
5
87
142
97
45
22
0
{-# LANGUAGE BangPatterns, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module PB.KRPC.Tuple (Tuple(..)) where import Prelude ((+), (/)) import qualified Prelude as Prelude' import qualified Data.Typeable as Prelude' import qualified Data.Data as Prelude...
Cahu/krpc-hs
src/PB/KRPC/Tuple.hs
gpl-3.0
3,434
0
19
743
799
411
388
66
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-genomics/gen/Network/Google/Resource/Genomics/Variants/Get.hs
mpl-2.0
5,328
0
18
1,327
862
502
360
121
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Delete.hs
mpl-2.0
3,353
0
14
727
386
232
154
63
1
module Problem019 where main = print $ length $ f (Day 1 1 1901 1) [] where f day@(Day d m y w) c | d == 1 && m == 1 && y == 2000 = c | d == 1 && w == 7 = f (next day) (day:c) | otherwise = f (next day) c data Day d = Day { day :: Int ...
vasily-kartashov/playground
euler/problem-019.hs
apache-2.0
1,228
0
20
698
573
289
284
25
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="pt-BR"> <title>DOM XSS Active Scan Rule | ZAP Extension</title> <maps> <homeID>top</homeID>...
0xkasun/security-tools
src/org/zaproxy/zap/extension/domxss/resources/help_pt_BR/helpset_pt_BR.hs
apache-2.0
986
80
66
163
421
213
208
-1
-1
module CI.Docker.Parse ( getFroms , getFrom , Language.Dockerfile.parseString , Language.Dockerfile.parseFile , Language.Dockerfile.prettyPrint , Language.Dockerfile.prettyPrintInstructionPos , Language.Dockerfile.Dockerfile , Language.Dockerfile.InstructionPos(..) , Language.Dockerf...
lancelet/bored-robot
src/CI/Docker/Parse.hs
apache-2.0
648
0
9
109
158
95
63
19
1
module Problem023 where import Data.List main = print $ fetch (descent 999999) [0..] fetch is as = fetch' is as [] where fetch' [] as bs = reverse bs fetch' (i:is) as bs = fetch' is as' (b:bs) where b = as !! i as' = take i as ++ drop (i + 1...
vasily-kartashov/playground
euler/problem-024.hs
apache-2.0
551
0
12
214
260
136
124
13
2
{-# LANGUAGE OverloadedStrings #-} module Data.FastPack.Get ( GetData (..) , runFastUnpack ) where import Data.FastPack.TH import Data.FastPack.Types import qualified Data.List as DL import GHC.Err (error) import Language.Haskell.TH.Syntax data GetData = Ge...
erikd/fastpack
src/Data/FastPack/Get.hs
bsd-2-clause
3,317
0
30
794
1,131
573
558
78
4
fromIntegral :: (Num b, Integral a) => a -> b 函数名 TypeClass type parameters return value type
sharkspeed/dororis
languages/haskell/LYHGG/3-types-and-typeclasses/2-type-variables.hs
bsd-2-clause
117
2
6
34
41
20
21
-1
-1
-- 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. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. module Duckling.E...
rfranek/duckling
Duckling/Engine/Regex.hs
bsd-3-clause
415
0
5
74
35
25
10
4
0
module Advent.Day3 where import qualified Data.Text as T import Data.List import Text.Parsec import Control.Lens import qualified Data.MultiSet as MultiSet import Control.Arrow ((>>>)) data Direction = North | South | East | West deriving (Eq, Show) type House = (Int, Int) parseDirections :: T.Text -> Either ParseEr...
screamish/adventofhaskellcode
src/Advent/Day3.hs
bsd-3-clause
1,223
0
13
289
504
283
221
43
4
{-# LANGUAGE OverloadedStrings #-} module Network.IRC.Bot.Part.Hello where import Control.Monad.Trans (liftIO) import Data.Maybe (fromMaybe) import Data.ByteString (ByteString) import Data.Monoid ((<>)) import Network.IRC.Bot.Log (LogLevel(Debug)) import Network.IRC.Bot.Bo...
eigengrau/haskell-ircbot
Network/IRC/Bot/Part/Hello.hs
bsd-3-clause
1,193
0
13
268
377
212
165
26
1
{-# LANGUAGE TypeFamilies, MultiParamTypeClasses, FlexibleContexts #-} -- This alternate, much simpler syntax, is aimed at unifying our current -- interpreters, so as to lessen the code duplication in the tests. -- It is not meant to be 'general', that is what Syntax is for. module Language.Hakaru.Syntax2 where -- We...
zaxtax/hakaru-old
Language/Hakaru/Syntax2.hs
bsd-3-clause
2,351
0
11
480
480
275
205
-1
-1
module Day16 where import Data.Bits import Data.ByteString as BS import qualified Data.List as List import Data.List.Split import Data.Monoid import Data.Word type BS = BS.ByteString type BB = [Bool] input = "11101000110010100" len1 :: Int len1 = 272 len2 :: Int len2 = 35651584 toBS :: String -> BS toBS = pack . ...
mbernat/aoc16-haskell
src/Day16.hs
bsd-3-clause
1,302
0
11
359
592
318
274
41
3
{-# LANGUAGE GADTs #-} {-# LANGUAGE TemplateHaskell #-} -- | -- Module : Data.Array.Accelerate.CUDA.Analysis.Launch -- Copyright : [2008..2014] Manuel M T Chakravarty, Gabriele Keller -- [2009..2014] Trevor L. McDonell -- License : BSD3 -- -- Maintainer : Trevor L. McDonell <tmcdonel...
kumasento/accelerate-cuda
Data/Array/Accelerate/CUDA/Analysis/Launch.hs
bsd-3-clause
7,775
0
12
1,937
1,865
970
895
99
9
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE BangPatterns #-} module Lib where import qualified Data.ByteString.Char8 as BS import Data.ByteString (ByteString) import Data.Monoid import Debug.Trace findLT :: ByteString -> ByteString -> Int findLT db w = lowerbound db w 0 top where top = BS.length db -- lb poin...
erantapaa/hoggle
src/Lib.hs
bsd-3-clause
1,782
0
15
548
650
325
325
40
1
module EditorCommands where import MT(MT(..)) import System(system,getArgs) import IO(hPutStrLn ,hGetLine ,hClose ,hSetBuffering ,BufferMode(..) ,IOMode(..) ,Handle ,stdin ,stderr) import Control.OldException as Exception import Foreign import Fo...
forste/haReFork
refactorer/EditorCommands.hs
bsd-3-clause
8,081
69
23
2,322
1,475
820
655
146
2
module HTML where mainHTML :: Int -> Int -> String -> String -- generate the main HTML file with a canvas of given width and height mainHTML width height javascriptFileName = "<!doctype html>\n" ++ "<html lang=\"en\">\n" ++ "<head charset=\"UTF-8\">\n" ++ "<title>This is my first canvas</title>\n" ...
ckkashyap/Dancer
HTML.hs
bsd-3-clause
2,332
0
41
543
378
191
187
60
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE Typ...
Garygunn94/DFS
AuthServer/.stack-work/intero/intero15053Txj.hs
bsd-3-clause
14,188
309
18
3,828
3,224
1,744
1,480
278
4
{-# LANGUAGE QuasiQuotes #-} {-@ LIQUID "--no-termination "@-} {-@ LIQUID "--diff "@-} import LiquidHaskell import Language.Haskell.Liquid.Prelude data RBTree a = Leaf | Node Color a !(RBTree a) !(RBTree a) deriving (Show) data Color = B -- ^ Black | R -- ^ Red ...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/RBTree.hs
bsd-3-clause
8,985
21
17
3,132
2,435
1,219
1,216
113
7
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeOperators #-} module Lib ( startApp ) where import Control.Monad.Trans.Either import Data.Aeson import Data.Aeson.TH import Data.Text as T import Network.Wai import Network.Wai.Handler.Warp i...
vulgr/vulgr-simple
src/Lib.hs
bsd-3-clause
2,493
0
17
698
668
366
302
75
1
{- | Module : Database.HDBC.Sqlite3 Copyright : Copyright (C) 2005-2011 John Goerzen License : BSD3 Maintainer : John Goerzen <jgoerzen@complete.org> Stability : provisional Portability: portable HDBC driver interface for Sqlite 3.x. Written by John Goerzen, jgoerzen\@complete.org -} modu...
hdbc/hdbc-sqlite3
Database/HDBC/Sqlite3.hs
bsd-3-clause
714
0
6
123
75
52
23
9
0
-------------------------------------------------------------------------------- {-# LANGUAGE ExistentialQuantification #-} module Hakyll.Web.Template.Context ( ContextField (..) , Context (..) , field , constField , listField , functionField , mapContext , defaultContext , bodyFiel...
freizl/freizl.github.com-old
src/Hakyll/Web/Template/Context.hs
bsd-3-clause
10,303
0
15
2,414
1,770
961
809
152
2
{-# LANGUAGE CPP, OverloadedStrings, TypeSynonymInstances,StandaloneDeriving,DeriveDataTypeable,ScopedTypeVariables, MultiParamTypeClasses, PatternGuards, NamedFieldPuns, TupleSections, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- | -- Module : Language.Haskell.BuildWrapper.GHC -- Copyright : (c)...
JPMoresmau/BuildWrapper
src/Language/Haskell/BuildWrapper/GHC.hs
bsd-3-clause
75,348
1,084
36
27,316
15,797
8,607
7,190
1,083
15