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
-- Copyright 2020 Google LLC -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in ...
google/hrepl
hrepl/tests/CLib2.hs
apache-2.0
688
0
6
116
31
24
7
3
0
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QAbstractSpinBox.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:36 Warning : this file is machine generated -...
keera-studios/hsQt
Qtc/Enums/Gui/QAbstractSpinBox.hs
bsd-2-clause
7,971
0
18
1,812
2,203
1,086
1,117
192
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE Rank2Types #-} module EFA.Data.Vector where import qualified Data.Vector.Unboxed as UV import qualified Data.Vector as V i...
energyflowanalysis/efa-2.1
src/EFA/Data/Vector.hs
bsd-3-clause
20,581
0
17
5,027
8,019
4,165
3,854
494
4
module Auto.Score ( BitString , bitStringToNum , mutateBitString , crossBitString , numToBitString , makeIndividual , makePopulation , flipBitAt ) where import Data.Array import System.Random -- type ScoreType = Double -- class Score a w...
iu-parfunc/AutoObsidian
src/Auto/Score.hs
bsd-3-clause
2,161
0
11
551
801
428
373
49
3
{-# LANGUAGE CPP #-} #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy #-} #endif {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} -------------...
phaazon/either
src/Control/Monad/Trans/Either.hs
bsd-3-clause
9,810
0
20
2,184
3,134
1,640
1,494
218
2
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} -- import Data.Char (isPunctuation, isSpace) -- import Data.List (intercalate) -- import Data.Monoid (mappend) import Data.Text (Text) import qualified Data.Map.Strict as Map import Control.Exception (finally) import Control.Monad (forM_, forever) impo...
triplepointfive/battleship
app/Main.hs
bsd-3-clause
5,602
0
23
1,277
1,530
782
748
126
5
module Day1 where import Data.List (findIndex, inits) -- slower than a foldr (does 2 passes over input), but more readable/declarative floorCount :: String -> Int floorCount input = ups - downs where ups = charCount '(' input downs = charCount ')' input charCount c = length . filter (== c) floorC...
yarbroughw/advent
src/Day1.hs
bsd-3-clause
706
0
9
170
226
118
108
19
3
{-# LANGUAGE TypeFamilies #-} module Language.Shelspel.Codegen.Bash where import Language.Shelspel.AST import Language.Shelspel.Codegen.Types import Control.Monad codegen :: Program -> String codegen prog = script where bash = flip execState empty $ cgen prog script = foldl (++) "" $ reverse bash ty...
badi/shelspel
src/Language/Shelspel/Codegen/Bash.hs
bsd-3-clause
4,704
0
16
1,820
1,508
696
812
165
1
{-# LANGUAGE OverloadedStrings, ViewPatterns #-} import Control.Exception (catch, SomeException) import Control.Monad import Control.Monad.Trans (liftIO) import qualified Data.ByteString.UTF8 as B import Data.List (isPrefixOf, sortBy) import Data.Maybe import Safe (readMay) import System.Directory import System.Enviro...
sethfowler/pygmalion
tools/Pygmalion.hs
bsd-3-clause
13,828
0
17
3,937
4,083
1,957
2,126
241
4
-- Copyright (c) 2012-2013, Christoph Pohl BSD License (see -- http://www.opensource.org/licenses/BSD-3-Clause) ------------------------------------------------------------------------------- -- -- Project Euler Problem 13 -- -- The following iterative sequence is defined for the set of positive -- integers: -- -- n →...
Psirus/euler
src/euler014.hs
bsd-3-clause
1,403
0
11
283
227
128
99
14
1
{-# LANGUAGE CPP, MagicHash #-} #if __GLASGOW_HASKELL__ >= 703 {-# LANGUAGE Unsafe #-} #endif -- | -- Copyright : (c) 2010 Simon Meier -- -- Original serialization code from 'Data.Binary.Builder': -- (c) Lennart Kolmodin, Ross Patterson -- -- License : BSD3-style (see LICENSE) -- -- Ma...
DavidAlphaFox/ghc
libraries/bytestring/Data/ByteString/Builder/Prim/Internal/UncheckedShifts.hs
bsd-3-clause
2,954
0
9
551
400
250
150
30
3
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell {-@ LIQUID "--no-termination "@-} import Language.Haskell.Liquid.Prelude incr x = (x, [x+1]) chk (x, [y]) = liquidAssertB (x <y) prop = chk $ incr n where n = choose 0 incr2 x = (True, 9, x, 'o', x+1) chk2 (_, _, x, _, y) = liquidAssertB (x <y) prop2 = c...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/pair00.hs
bsd-3-clause
471
0
8
112
249
140
109
15
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE AllowAmbiguousTypes #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} module Plots.API ( -- * D...
bergey/plots
src/Plots/API.hs
bsd-3-clause
17,846
0
11
3,773
3,273
1,846
1,427
-1
-1
module ETA.CodeGen.Env where import ETA.BasicTypes.Id import ETA.StgSyn.StgSyn import ETA.Types.Type import ETA.Types.TyCon import Codec.JVM import ETA.Util import ETA.Debug import ETA.CodeGen.Types import ETA.CodeGen.Closure import ETA.CodeGen.Monad import ETA.CodeGen.Utils import ETA.CodeGen.ArgRep import ETA.Cod...
alexander-at-github/eta
compiler/ETA/CodeGen/Env.hs
bsd-3-clause
3,536
0
12
600
1,239
622
617
-1
-1
module Rho.TrackerComms.PeerResponse where import Data.Monoid import Data.Word (Word32) import Network.Socket (SockAddr) data PeerResponse = PeerResponse { prInterval :: Word32 , prLeechers :: Maybe Word32 , prSeeders :: Maybe Word32 , prPeers :: [SockAddr] } deriving ...
osa1/rho-torrent
src/Rho/TrackerComms/PeerResponse.hs
bsd-3-clause
735
0
10
211
264
142
122
18
0
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} -- | This module is intended to be imported @qualified@, for example: -- -- > import qualified Test.Tasty.Laws.Functor as Functor -- module Test.Tasty.Laws.Functor ( testUnit , test , testExhaustive , testSeries , test...
jdnavarro/tasty-laws
Test/Tasty/Laws/Functor.hs
bsd-3-clause
4,265
0
12
1,049
874
499
375
42
1
{-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} module Main where import Data.List (sort) import qualified Data.StringMap as M import qualified Data.StringMap.Dim2Search as D2 -- ---------------------------------------- -- -- auxiliary functions fo...
alexbiehl/StringMap
tests/Dim2Test.hs
mit
7,588
0
13
2,262
3,022
1,639
1,383
171
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-| Copyright: Aaron Taylor, 2016 License: MIT Maintainer: aaron@hamsterdam.co Class, instances and transformer for monads capable of HTTP request...
hamsterdam/kawhi
library/Control/Monad/Http.hs
mit
2,822
0
17
691
585
326
259
45
1
data A a = A (A a a)
roberth/uu-helium
test/kinderrors/KindError7.hs
gpl-3.0
22
0
8
9
19
10
9
1
0
{-# LANGUAGE TupleSections #-} {-# LANGUAGE OverloadedStrings #-} -------------------------------------------------------------------- -- | -- Copyright : (c) Edward Kmett and Dan Doel 2013 -- License : BSD2 -- Maintainer: Edward Kmett <ekmett@gmail.com> -- Stability : experimental -- Portability: non-portable --...
PipocaQuemada/ermine
src/Ermine/Parser/Pattern.hs
bsd-2-clause
2,871
2
16
570
780
427
353
65
2
{-# LANGUAGE DeriveDataTypeable #-} module Distribution.Client.Cron ( cron , Signal(..) , ReceivedSignal(..) , rethrowSignalsAsExceptions ) where import Control.Monad (forM_) import Control.Exception (Exception) import Control.Concurrent (myThreadId, threadDelay, throwTo) import System.Random (randomRIO) imp...
haskell-infra/hackage-server
Distribution/Client/Cron.hs
bsd-3-clause
2,758
0
17
623
688
363
325
58
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleInstances #-} -- | Generate HPC (Haskell Program Coverage) reports module Stack.Coverage ( delet...
mathhun/stack
src/Stack/Coverage.hs
bsd-3-clause
20,063
0
28
6,609
4,547
2,305
2,242
336
9
{-| Module : Idris.IBC Description : Core representations and code to generate IBC files. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE TypeSynonymInstances #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Idris.IBC (loadIBC, loadPkgIndex, writeIBC,...
tpsinnem/Idris-dev
src/Idris/IBC.hs
bsd-3-clause
100,046
0
21
55,355
27,569
12,662
14,907
2,406
17
-- | Build instance tycons for the PData and PDatas type families. -- -- TODO: the PData and PDatas cases are very similar. -- We should be able to factor out the common parts. module Vectorise.Generic.PData ( buildPDataTyCon , buildPDatasTyCon ) where import Vectorise.Monad import Vectorise.Builtins import V...
vTurbine/ghc
compiler/vectorise/Vectorise/Generic/PData.hs
bsd-3-clause
6,567
0
14
2,207
1,369
689
680
122
5
{-# OPTIONS -Wall -fno-warn-missing-signatures -fno-warn-name-shadowing #-} -- | Load the configuration file. module HN.Config (getConfig) where import HN.Types import Data.ConfigFile import Database.PostgreSQL.Simple (ConnectInfo(..)) import qualified Data.Text as T import Network.Mail.Mime import Github.Auth (Git...
lwm/haskellnews
src/HN/Config.hs
bsd-3-clause
1,545
0
18
421
459
245
214
39
2
{-# LANGUAGE ForeignFunctionInterface #-} module Main where import Foreign.C.Types foreign import ccall "foo" foo :: IO CInt main :: IO () main = foo >>= print
sdiehl/ghc
testsuite/tests/ffi/should_run/T17471.hs
bsd-3-clause
163
0
6
29
45
26
19
6
1
{-# LANGUAGE EmptyDataDecls #-} module Opaleye.SQLite.PGTypes (module Opaleye.SQLite.PGTypes) where import Opaleye.SQLite.Internal.Column (Column) import qualified Opaleye.SQLite.Internal.Column as C import qualified Opaleye.SQLite.Internal.PGTypes as IPT import qualified Opaleye.SQLite.Internal.HaskellDB....
bergmark/haskell-opaleye
opaleye-sqlite/src/Opaleye/SQLite/PGTypes.hs
bsd-3-clause
4,512
0
9
626
995
558
437
-1
-1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="id-ID"> <title>Kode Dx | ZAP Perpanjangan</title> <maps> <homeID>top</homeID> <mapref l...
kingthorin/zap-extensions
addOns/codedx/src/main/javahelp/org/zaproxy/zap/extension/codedx/resources/help_id_ID/helpset_id_ID.hs
apache-2.0
966
78
66
159
413
209
204
-1
-1
module CRC32 (crc32_tab, crc32, crc32String) where import Data.Bits import Data.Word import Data.Char -- table and sample code derived from -- http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/libkern/crc32.c -- * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or -- * code or tables extr...
seahug/parconc-examples
crc32/CRC32.hs
bsd-3-clause
3,868
100
15
488
1,059
670
389
58
2
----------------------------------------------------------------------------- -- | -- Module : Xmobar.Commands -- Copyright : (c) Andrea Rossato -- License : BSD-style (see LICENSE) -- -- Maintainer : Jose A. Ortega Ruiz <jao@gnu.org> -- Stability : unstable -- Portability : unportable -- -- The 'Ex...
dragosboca/xmobar
src/Commands.hs
bsd-3-clause
2,869
0
17
957
722
382
340
54
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Foreign.C.String -- Copyright : (c) The FFI task force 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer :...
ryantm/ghc
libraries/base/Foreign/C/String.hs
bsd-3-clause
14,693
0
16
2,992
2,349
1,293
1,056
162
3
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} -- | Tag a Binary instance with the stack version number to ensure we're -- reading a compatible format. module Data.Binary.VersionTagged ( taggedDecodeOrLoad ,...
Denommus/stack
src/Data/Binary/VersionTagged.hs
bsd-3-clause
3,538
0
15
939
854
456
398
85
2
{-# OPTIONS_GHC -fplugin LinkerTicklingPlugin #-} module Main where main :: IO () main = return ()
siddhanathan/ghc
testsuite/tests/plugins/plugins06.hs
bsd-3-clause
101
0
6
18
25
14
11
4
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Main where import qualified Prelude import RIO import Control.Teardown main :: IO () main = do baruta <- newTeardown "baruta" (return () :: IO ()) bqto <- newTeardown "barquisimeto" (return () :: IO ()) colombia <- ...
roman/Haskell-teardown
examples/teardown-example/src/Main.hs
isc
764
0
11
171
266
133
133
18
1
{-# LANGUAGE FlexibleContexts #-} module XmlParse where import qualified Data.Char as Char import Data.Conduit.Attoparsec import Data.Text (Text) import qualified Data.Text as Text import qualified Data.XML.Types as XML import Text.Megaparsec import Text.Megaparsec.Prim import Text.Megaparsec.Pos import XmlEvents imp...
scott-fleischman/haskell-xml-infer
src/XmlParse.hs
mit
4,024
0
19
667
1,410
715
695
80
3
module Main where import qualified ExpressionProblem1a as EP1a import qualified ExpressionProblem1b as EP1b import qualified ExpressionProblem2a as EP2a import qualified ExpressionProblem2b as EP2b import qualified ExpressionProblem3a as EP3a import qualified ExpressionProblem3b as EP3b -- References -- http://c2.com...
rcook/expression-problem
src/Main.hs
mit
2,520
0
13
380
441
235
206
40
1
import Data.List (sortBy) import Data.Ord (comparing) collatz :: Integer -> [Integer] collatz n | n == 1 = [1] | n `mod` 2 == 0 = n : collatz (n `div` 2) | otherwise = n : collatz (3 * n + 1) collatzSequences :: Integer -> [[Integer]] collatzSequences n = map...
DylanSp/Project-Euler-in-Haskell
prob14/solution.hs
mit
611
0
10
153
225
119
106
12
1
module Rubik.Tables.Distances where import Rubik.Cube import Rubik.Solver import Rubik.Tables.Internal import Rubik.Tables.Moves import qualified Data.Vector.Storable.Allocated as S import qualified Data.Vector.HalfByte as HB d_CornerOrien_UDSlice = distanceTable2 "dist_CornerOrien_UDSlice" move18CornerOrien move18...
Lysxia/twentyseven
src/Rubik/Tables/Distances.hs
mit
1,328
0
9
247
215
121
94
39
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ConstraintKinds #-} -- | Warning: This module should be considered highly experimental. module Data.Sequences where import Data.Maybe (fromJust, isJust) import Data.Mono...
pikajude/mono-traversable
src/Data/Sequences.hs
mit
44,679
0
13
12,140
8,133
4,665
3,468
1,029
2
module SecretHandshake (handshake) where handshake :: Int -> [String] handshake n = error "You need to implement this function."
exercism/xhaskell
exercises/practice/secret-handshake/src/SecretHandshake.hs
mit
130
0
6
20
32
18
14
3
1
module DebugDisplay (toBinaryRepresentation) where import Utilities(testBitAt) import Data.Word(Word8) import Data.Bits(Bits) -- Useful Debug Display Functions toBinaryRepresentation :: Bits a => [a] -> String toBinaryRepresentation [] = [] toBinaryRepresentation (x:xs) = (concat [show $ boolToInt . testBitAt n $ x...
tombusby/haskell-des
debug/DebugDisplay.hs
mit
443
0
11
71
155
84
71
10
2
module Jbobaf ( module Jbobaf.Jitro, module Jbobaf.Lerfendi, module Jbobaf.Selmaho, module Jbobaf.Valsi, module Jbobaf.Vlatai ) where import Jbobaf.Jitro import Jbobaf.Lerfendi import Jbobaf.Selmaho import Jbobaf.Valsi import Jbobaf.Vlatai
jwodder/jbobaf
haskell/Jbobaf.hs
mit
245
0
5
30
61
39
22
11
0
{-# LANGUAGE OverloadedStrings #-} import CFDI (UUID(..)) import CFDI.PAC (ppCancelError, cancelCFDI) import CFDI.PAC.Dummy (Dummy(..)) import CFDI.PAC.Fel (Fel(Fel), FelEnv(..)) import CFDI.PAC.ITimbre (ITimbre(ITimbre), ITimbreEnv(..)) import qualified Data.ByteString.Char8 as C8 (putStrLn) import Data.Char (toLower...
yusent/cfdis
cancel_cfdi/main.hs
mit
2,827
0
23
1,041
756
376
380
71
10
{-# LANGUAGE RecursiveDo #-} module Types.Parser.Types ( Imperative (..) , VerbPhrase (..) , NounPhrase (..) , PrepPhrase (..) , AdjPhrase (..) , Noun , Verb , Determiner , Preposition , Adjective ) where import Prelude import Data.Text data Imperative = Type1 VerbPhrase NounPhrase ...
mlitchard/cosmos
library/Types/Parser/Types.hs
mit
1,136
0
6
387
224
140
84
37
0
-- copied from stackoverflow. review later to reenact combinations :: Int -> [a] -> [[a]] combinations k xs = combinations' (length xs) k xs where combinations' n k' l@(y:ys) | k' == 0 = [[]] | k' >= n = [l] | null l = [] | otherwise = map (y :) (combinations' (n - 1) (k' -...
HenningBrandt/Study
Sieve_Method/sieve.hs
mit
1,159
0
13
326
562
287
275
28
2
module Palindrome where import Utils ((|>)) import Control.Monad import System.Exit (exitSuccess) import Data.Char palindrome :: IO () palindrome = forever $ do line1 <- getLine case (isPalindrome line1) of True -> do putStrLn "It's a palindrome" exitSuccess False -> putStrLn "Not...
andrewMacmurray/haskell-book-solutions
src/ch13/palindrome.hs
mit
480
0
13
122
160
83
77
20
2
{-# LANGUAGE NoMonomorphismRestriction #-} module Plugins.Gallery.Gallery.Manual52 where import Diagrams.Prelude example = hcat [ square 2 , circle 1 # withEnvelope (square 3 :: D R2) , square 2 , text "hi" <> phantom (circle 2 :: D R2) ]
andrey013/pluginstest
Plugins/Gallery/Gallery/Manual52.hs
mit
311
0
10
111
84
44
40
7
1
{-# LANGUAGE OverloadedLists #-} module Irg.Lab1.Geometry.Shapes where import qualified Irg.Lab1.Geometry.Vector as V import qualified Data.Vector as V2 import Data.Maybe import Debug.Trace type Number = Float myTrace :: Show a => a -> a myTrace x = if False then traceShowId x else x polygonFill :: Polygon -> [(Do...
DominikDitoIvosevic/Uni
IRG/src/Irg/Lab1/Geometry/Shapes.hs
mit
4,980
0
17
1,164
1,804
939
865
99
2
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} module Widgets.LoadingSplash ( loadingSplash, loadingSplashD ) where import qualified Reflex.Dom as Dom import Control.Lens ((.~), (&)) import Commons import Widgets.Generation -- | Whe...
achirkin/qua-view
src/Widgets/LoadingSplash.hs
mit
5,130
0
12
1,470
251
137
114
24
2
{-# LANGUAGE OverloadedStrings #-} import Control.Monad.Trans.Resource import Data.Conduit (($$)) import Data.Conduit.List (sinkNull) import Data.Map (Map, empty, insert) import Data.Text (Text, unpack) import Text.XML.Stream.Parse import Text.XML (Name, nameLocalName) data Person = Person Int Text deriving Show ...
kberger/xml-streaming
Xml.hs
mit
674
0
15
108
226
122
104
18
1
module AuthBench (benchAuth, authEnv) where import Criterion.Main import Control.Monad import Control.DeepSeq import Control.Exception import Data.ByteString as BS import Crypto.Saltine.Core.Auth import BenchUtils authEnv :: IO Key authEnv = newKey benchAuth :: Key -> Benchmark benchAuth k = do let authVerify ...
tel/saltine
bench/AuthBench.hs
mit
825
0
15
227
269
136
133
26
1
import System.Environment (getArgs) import Data.List import Data.List.Split import Control.Monad import System.Console.ANSI import Juicer.Freeze import Juicer.Puree main :: IO() main = do args <- getArgs case args of (archivename:[]) -> do maybeArchive <- thaw archivename case maybeArchive of...
blanu/juicer
pour.hs
gpl-2.0
1,903
0
16
375
609
289
320
60
3
module Game where import DIYGraph import Parse import Dictionary import Graph import Places import Player import Text.ParserCombinators.Parsec.Error -- TODO -- change mapGraph to places, game to gameState data Game = Game { player :: Player, mapGraph :: Graph Place String, dict...
emhoracek/explora
library/Game.hs
gpl-2.0
1,495
0
9
361
298
159
139
24
1
module Main where import Lexical import Scanner import Parser import Weeder import AST import System.Directory -------------------------------------------------------------------- testVFiles :: IO [(String, String)] testVFiles = do f <- getDirectoryContents "assignment_testcases/a1" let files = ["assignment...
yangsiwei880813/CS644
src/WMain.hs
gpl-2.0
3,044
0
21
628
1,343
681
662
53
1
module Main where import TheNotes main :: IO () main = theNotes
NorfairKing/the-notes
app/Main.hs
gpl-2.0
76
0
6
24
22
13
9
4
1
module Blockchain.Structures where import qualified Data.Digest.Pure.SHA as SHA import qualified Data.ByteString.Lazy as B import qualified Data.Binary.Get as BI import qualified Data.Map as Map -- Account-based proof-of-stake cryptocurrency model type Timestamp = Int first8bytesAsNumber :: B.ByteString -> Integer f...
ConsensusResearch/ForgingSimulation
blockchain.hs
gpl-2.0
8,422
0
14
1,923
2,426
1,282
1,144
160
3
-- 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without -- any remainder. -- What is the smallest positive number that is evenly divisible by all of the numbers from 1 -- to 20? -- lcm is what we need for this listLCM xs = foldr (lcm) 2 xs ans = listLCM [3..20]
ciderpunx/project_euler_in_haskell
euler005.hs
gpl-2.0
308
0
6
70
37
21
16
2
1
module QFeldspar.CSE where import QFeldspar.Expression.GADTFirstOrder import QFeldspar.Expression.Utils.Equality.GADTFirstOrder import QFeldspar.Expression.Utils.GADTFirstOrder(prdAllM,sucAll,isVal) import QFeldspar.MyPrelude hiding (foldl,fmap) import qualified QFeldspar.Type.GADT as TG import QFeldspar.ChangeMonad...
shayan-najd/QFeldspar
QFeldspar/CSE.hs
gpl-3.0
9,586
0
38
4,479
3,817
1,920
1,897
-1
-1
-- | -- Module : Language.Go.Parser.Tokens -- Copyright : (c) 2011 Andrew Robbins -- License : GPLv3 (see COPYING) -- -- This module defines Go tokens and the parser type. -- It also defines various utility functions for the lexer and parser. module Language.Go.Parser.Tokens ( -- * Parser GoParser, Go...
remyoudompheng/hs-language-go
Language/Go/Parser/Tokens.hs
gpl-3.0
13,285
0
15
4,322
3,743
2,050
1,693
357
18
--- | --- | This module contains the DC-stuff for connections to other peers --- | --- Copyright : (c) Florian Richter 2011 --- License : GPL --- module DCToClient ( startupClient , handleClient , stopClient , downloadFilelist , downloadFile ) where import System.IO import System.Timeo...
f1ori/hadcc
DCToClient.hs
gpl-3.0
12,653
142
13
5,564
2,598
1,346
1,252
217
25
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} module CompilerUtils ( fromList, Migration(..), MigrationMap, compiledMain ) where import Control.Exception (SomeException, catch) import Control.Monad (forM_, void) import Data.Map (Map, fromList) import qualified Data.Map as M import Database.PostgreSQL.Simpl...
alevy/postgresql-orm
static/CompilerUtils.hs
gpl-3.0
3,481
0
20
1,003
877
445
432
80
5
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-drive/gen/Network/Google/Resource/Drive/Replies/Delete.hs
mpl-2.0
3,289
0
16
826
467
278
189
72
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-datastore/gen/Network/Google/Resource/Datastore/Projects/Operations/Cancel.hs
mpl-2.0
5,850
0
15
1,202
716
425
291
101
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-adsense-host/gen/Network/Google/Resource/AdSenseHost/Accounts/Reports/Generate.hs
mpl-2.0
7,121
0
22
1,758
1,135
656
479
156
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-admin-directory/gen/Network/Google/Resource/Directory/Resources/Buildings/Get.hs
mpl-2.0
5,427
0
21
1,314
795
463
332
119
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-resourcemanager/gen/Network/Google/Resource/CloudResourceManager/TagValues/GetIAMPolicy.hs
mpl-2.0
6,141
0
16
1,295
790
465
325
117
1
module LastDigit where -- fastPower :: Integer -> Integer -> Integer -- fastPower a b = mod (b * (fastPower (a - 1) b)) 10 -- lastDigit :: Integer -> Integer -> Integer -- lastDigit _ 9460519178175124365941571214880402830019368270018729041658731800055367147675563748201080421764071920 = 6 -- lastDigit b 0 = 1 -- lastD...
ice1000/OI-codes
codewars/101-200/last-digit-of-a-large-number.hs
agpl-3.0
1,383
0
11
298
340
178
162
15
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} {- Bustle.UI.FilterDialog: allows the user to filter the displayed log Copyright © 2011 Collabora Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by th...
wjt/bustle
Bustle/UI/FilterDialog.hs
lgpl-2.1
4,963
0
14
1,156
1,127
566
561
89
3
module QuickCheckTests where import Test.QuickCheck import Data.List (sort) import Data.Char (toUpper) gen :: (Arbitrary a) => Gen a gen = do a <- arbitrary return a divisor :: Gen Float divisor = arbitrary `suchThat` (/= 0) half x = x / 2 halfIdentity = ((*2) . half) prop_half :: Property prop_half = forAll...
thewoolleyman/haskellbook
14/07/maor/QuickCheckTests.hs
unlicense
2,988
0
12
676
1,344
698
646
92
3
module Coins.A265415 (a265415) where import Coins.A260643 (a260643_list) import Data.List (elemIndices) a265415 :: Int -> Int a265415 n = a265415_list !! (n - 1) a265415_list :: [Int] a265415_list = map (+1) $ elemIndices 1 a260643_list
peterokagey/haskellOEIS
src/Coins/A265415.hs
apache-2.0
239
0
7
36
88
50
38
7
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="ru-RU"> <title>Highlighter</title> <maps> <homeID>highlighter</homeID> <mapref location...
secdec/zap-extensions
addOns/highlighter/src/main/javahelp/help_ru_RU/helpset_ru_RU.hs
apache-2.0
964
114
29
155
420
208
212
-1
-1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} module Spark.Core.Internal.ColumnStructures where import Control.Arrow ((&&&)) import Data.Function(on) import Data.Vector(Vector) import Spark...
tjhunter/karps
haskell/src/Spark/Core/Internal/ColumnStructures.hs
apache-2.0
3,393
0
11
548
377
229
148
-1
-1
module Nanocoin.Network.RPC ( rpcServer ) where import Protolude hiding (get, intercalate, print, putText) import Data.Aeson hiding (json, json') import Data.Text (intercalate) import Web.Scotty import Data.List ((\\)) import qualified Data.Map as Map import Logger import Address import qualified Address import...
tdietert/nanocoin
src/Nanocoin/Network/RPC.hs
apache-2.0
2,533
0
22
543
610
313
297
64
3
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.APPLE.FloatPixels -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/APPLE/FloatPixels.hs
bsd-3-clause
1,012
0
4
117
76
57
19
16
0
module Data.Strict.Maybe where data Maybe' a = Just' !a | Nothing' lazy :: Maybe' a -> Maybe a lazy Nothing' = Nothing lazy (Just' a) = Just a {-# INLINABLE lazy #-} strict :: Maybe a -> Maybe' a strict Nothing = Nothing' strict (Just a) = Just' a {-# INLINABLE strict #-} maybe' :: b -> (a -> b) -> Maybe' a -> b ...
effectfully/prefolds
src/Data/Strict/Maybe.hs
bsd-3-clause
397
0
8
90
164
84
80
13
1
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} module Lichen.Plagiarism.Render where import Data.Monoid ((<>)) import Text.Blaze.Html5 ((!)) import qualified Text.Blaze.Html5 as H import qualified Text.Blaze.Html5.Attributes as A import Clay ((?)) import qualified Clay as C import qualified Clay.Size as C.S import...
Submitty/AnalysisTools
src/Lichen/Plagiarism/Render.hs
bsd-3-clause
4,602
0
14
1,542
735
396
339
49
1
{-# LANGUAGE GADTs, KindSignatures, RankNTypes, ScopedTypeVariables, StandaloneDeriving, FlexibleInstances #-} module Binder where import Expr import Transport data Bindee :: * -> * where Temperature :: Bindee StringExpr deriving instance Show (Bindee a) instance Read (Bindee StringExpr) where readsPrec d = re...
ku-fpg/remote-monad-examples
classic-examples/Deep/Binder.hs
bsd-3-clause
769
0
11
169
259
132
127
21
1
{-# LANGUAGE TemplateHaskell #-} module Dir.Everything(module Data.List.Extra, module Dir.Everything) where import Data.List.Extra import Language.Haskell.TH.Syntax import System.Timeout usedFunction1 = undefined :: (T1 -> T1) -> () usedFunction2 = Other unusedFunction = 12 :: Int (=~=) a b = a == b -- used (==~==) ...
ndmitchell/weeder
test/foo/src/Dir/Everything.hs
bsd-3-clause
797
0
9
171
307
185
122
29
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: $HEADER$ -- Description: Data type for RPM and DPKG package version -- Copyright: (c) 2014 Peter Trsko -- License: BSD3 -- -- Maintainer: peter.trsko@gmail.com -- Stability: experime...
trskop/pkg-version
src/Data/PkgVersion/Internal/PkgVersion.hs
bsd-3-clause
3,367
0
12
729
716
431
285
64
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} module Language.Rsc.Liquid.Qualifiers (scrapeQuals) where import Data.List (delete, nub) import Data.Maybe (fromMaybe) import Language.Fixpoint.Types hiding (quals) im...
UCSD-PL/RefScript
src/Language/Rsc/Liquid/Qualifiers.hs
bsd-3-clause
4,088
0
14
1,236
1,234
661
573
58
7
module Arbitrary where import Test.QuickCheck import qualified Data.ByteString.Lazy as BS import Frenetic.Common import Control.Monad import Nettle.Arbitrary import Frenetic.NetCore.Types hiding (Switch) import qualified Frenetic.NetCore.Types as NetCore import Frenetic.NetCore.Semantics import Frenetic.Topo arbPort ...
frenetic-lang/netcore-1.0
testsuite/Arbitrary.hs
bsd-3-clause
5,323
0
17
1,469
1,599
828
771
116
1
#!/usr/bin/env runhaskell {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-cse #-} -- This program can crashed by attempting to read an uninitialized 'IORef' with incorrect user input (when he chooses not to input a line after the confirmation) module Main where import Data.IORef import Data.Global import Syste...
bairyn/global
examples/uninitialized/Main.hs
bsd-3-clause
815
0
15
189
164
84
80
18
2
{-# LANGUAGE DeriveDataTypeable, FlexibleContexts #-} {-# LANGUAGE NoMonomorphismRestriction, OverloadedStrings, TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module KeyFlags (Masked(..), testCode, compatible, Keyboard(..), dec...
konn/hskk
cocoa/KeyFlags.hs
bsd-3-clause
3,268
0
10
951
876
497
379
96
1
module ProjectEuler.Problem225 (solution225) where import Data.List takeUntilSubSeq :: Eq a => [a] -> [a] -> [a] takeUntilSubSeq _ [] = [] takeUntilSubSeq ss (x : xs) = if ss `isPrefixOf` xs then [x] else x : takeUntilSubSeq ss xs modTribs :: Integer -> [Integer] modTribs n = modTribs' 1 1 1 where modTri...
guillaume-nargeot/project-euler-haskell
src/ProjectEuler/Problem225.hs
bsd-3-clause
641
0
13
124
260
142
118
16
2
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} module Test.Anemone.Foreign.Time where import Anemone.Foreign.Time import qualified Data...
ambiata/anemone
test/Test/Anemone/Foreign/Time.hs
bsd-3-clause
2,203
0
23
587
732
392
340
67
2
{-# LANGUAGE BangPatterns #-} module PLY.Internal.StrictReplicate where import Data.Vector.Generic (Vector, fromList) import Data.Vector.Fusion.Bundle.Monadic (fromStream, toList) import Data.Vector.Fusion.Bundle.Size (Size(..)) import Data.Vector.Fusion.Stream.Monadic (Stream (..), Step(..)) -- | Yield a 'Stream' of ...
acowley/ply-loader
src/PLY/Internal/StrictReplicate.hs
bsd-3-clause
1,137
0
13
247
295
161
134
17
1
module Language.Slice.Syntax.AST ( IncludeDelimiters(..) , Ident(..) , NsQualIdent(..) , SliceType(..) , SliceVal(..) , SliceDecl(..) -- , DefaultValue(..) , Annotation(..) , FieldDecl(..) , MethodDecl(..) , MethodOrFieldDecl(..) ) wher...
paulkoerbitz/language-slice
src/Language/Slice/Syntax/AST.hs
bsd-3-clause
2,057
0
9
672
531
314
217
44
0
module Settings.Builders.Cabal (cabalBuilderArgs) where import Hadrian.Builder (getBuilderPath, needBuilder) import Hadrian.Haskell.Cabal import Builder import Context import Flavour import Packages import Settings.Builders.Common import qualified Settings.Builders.Common as S cabalBuilderArgs :: Args cabalBuilderAr...
sdiehl/ghc
hadrian/src/Settings/Builders/Cabal.hs
bsd-3-clause
7,325
0
18
2,267
1,578
804
774
142
8
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} -------------------------------------------------------...
haskell-distributed/distributed-process-client-server
src/Control/Distributed/Process/ManagedProcess/Timer.hs
bsd-3-clause
7,031
0
14
1,811
1,146
634
512
107
2
module LetLang.Parser ( expression , program , parseProgram ) where import Control.Monad (void) import Data.Maybe (fromMaybe) import LetLang.Data import Text.Megaparsec import Text.Megaparsec.Expr import qualified Text.Megaparsec.Lexer as L import...
li-zhirui/EoplLangs
src/LetLang/Parser.hs
bsd-3-clause
5,590
0
14
1,365
1,549
815
734
147
2
----------------------------------------------------------------------------- -- | -- Module : XMonad.Actions.Submap -- Copyright : (c) Jason Creighton <jcreigh@gmail.com> -- License : BSD3-style (see LICENSE) -- -- Maintainer : Jason Creighton <jcreigh@gmail.com> -- Stability : unstable -- Portabili...
MasseR/xmonadcontrib
XMonad/Actions/Submap.hs
bsd-3-clause
2,784
0
17
718
398
219
179
23
2
{-# LANGUAGE TemplateHaskell, GADTs #-} module Input where import Control.Monad.IO.Class (MonadIO, liftIO) import Data.GADT.Compare.TH import Foreign.C.Types (CDouble(..)) import GHC.Float (float2Double) import qualified SFML.Window as SFML circleMass, circleRadius :: Num a => a circleMass = 10 circleRadius = 20 is...
Emmatipate/ava
src/Input.hs
bsd-3-clause
3,140
0
16
690
846
461
385
81
3
module StringCompressorKata.Day1Spec (spec) where import Test.Hspec import StringCompressorKata.Day1 (compress) spec :: Spec spec = do it "compresses nothing to empty string" $ do compress Nothing `shouldBe` "" it "compresses empty string to empty string" $ do ...
Alex-Diez/haskell-tdd-kata
old-katas/test/StringCompressorKata/Day1Spec.hs
bsd-3-clause
674
0
13
201
170
84
86
15
1
{-# LANGUAGE TypeFamilies #-} module QualifiedMethods where import qualified ExportListWildcards as ExportListWildcards import qualified DataFamilies as DataFamilies import OtherClass data Rodor = Rodor x :: ExportListWildcards.Foo x = ExportListWildcards.Foo1 instance ExportListWildcards.Bar Rodor where x Ro...
phischu/fragnix
tests/quick/QualifiedAssociates/QualifiedMethods.hs
bsd-3-clause
413
0
6
69
86
51
35
13
1
{-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-redundant-constraints #-} module Data.Type.BitRecords2.Writer.ByteStringBuilder where
sheyll/isobmff-builder
src/Data/Type/BitRecords2/Writer/ByteStringBuilder.hs
bsd-3-clause
152
0
3
13
11
9
2
3
0
{-# LANGUAGE CPP, TypeFamilies #-} ----------------------------------------------------------------------------- -- -- Machine-dependent assembly language -- -- (c) The University of Glasgow 1993-2004 -- ----------------------------------------------------------------------------- module X86.Instr (Instr(..), Operand...
ezyang/ghc
compiler/nativeGen/X86/Instr.hs
bsd-3-clause
40,860
0
17
12,981
9,638
4,884
4,754
626
102
-- -- -- ---------------- -- Exercise 6.9. ---------------- -- -- -- module E'6''9 where import E'6''8 ( rotate90 ) import Pictures ( Picture ) import Data.List ( transpose ) -- If picture is rectangular: rotate90anticlockwise :: Picture -> [[Char]] rotate90anticlockwise picture = reverse (transpose picture...
pascal-knodel/haskell-craft
_/links/E'6''9.hs
mit
500
0
8
87
110
67
43
10
1
{-# LANGUAGE NoImplicitPrelude #-} module TallyHo.CountMinSketchC ( module TallyHo.CountMinSketch , countMinSketchC ) where import ClassyPrelude.Conduit import TallyHo.CountMinSketch countMinSketchC :: (PrimMonad m, Hashable a) => Int -> Int -> Sink a m (CountMinSketch a) countMinSketchC d wShift = do ss <- lif...
non/tallyho
src/main/haskell/TallyHo/CountMinSketchC.hs
apache-2.0
402
0
10
67
119
61
58
11
1
module TypeInference1 where -- f x y=x+y+3 myConcat x = x ++ "yo" myMult x = (x/3)*5 myCom x = x > (length [1..10]) myAlph x = x < 'z' triple :: Int -> Int triple x = x * 3 x=5 -- y=x+5 -- w=y*10 -- x=5 -- y=x+5 -- f=4/y -- bigNum= (^)5 $ 10 -- a=(+) -- b=5 -- -- c=b 10 -- -- d=c 200 -- a=12+b -- b=10000*c...
punitrathore/haskell-first-principles
src/typeInference1.hs
bsd-3-clause
433
0
8
122
180
101
79
13
2
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE OverloadedStrings #-} module Test.Basement.UTF8 ( tests ) where import Basement.Types.CharUTF8 import Foundation import Foundation.Check import Foun...
vincenthz/hs-foundation
foundation/tests/Test/Basement/UTF8.hs
bsd-3-clause
436
0
12
82
74
44
30
13
1