code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
{-#LANGUAGE OverloadedStrings #-} module UI where import Control.Lens import Control.Monad import Control.Monad.Trans.Class import Control.Monad.Trans.RWS import Data.Text() import UI.NCurses import Shogi.Board import Shogi.Game data UIState = UIState { _game :: Game, _current :: (Integer,Integer)} game :: Lens' UI...
jtanguy/shogi
src/UI.hs
bsd-3-clause
3,871
4
21
1,195
955
500
455
-1
-1
{-# LANGUAGE GADTs, Rank2Types, CPP #-} ----------------------------------------------------------------------------------------- -- | -- Module : FRP.Yampa -- Copyright : (c) Antony Courtney and Henrik Nilsson, Yale University, 2003 -- License : BSD-style (see the LICENSE file in the distribution) -- --...
eigengrau/haskell-yampa
src/FRP/Yampa.hs
bsd-3-clause
17,282
0
5
6,045
869
715
154
120
0
module Sloch.Show ( showLangToSloc , showPathToLangToSloc ) where import Data.List (sort, sortBy) import Data.Monoid ((<>)) import qualified Data.Map as M import Cli (OptVerbose) import Language (Language) import Sloch (LangToSloc, PathToLangToSloc) showLangToSloc :: OptVerbose -> LangToSloc -> String s...
mitchellwrosen/Sloch
src/sloch/Sloch/Show.hs
bsd-3-clause
1,325
0
16
320
497
282
215
27
2
-- Advent of Code ---- Day 19: Medicine for Rudolph module AOC2015.Day19 where import qualified Data.Map.Lazy as ML import qualified Data.Set as S import Data.Char import Data.List -- | Map from molecule to list of molecules. type TransMap = ML.Map [String] [[String]] type StrListTuple = ([String],[String]) -- | L...
bitrauser/aoc
src/AOC2015/Day19.hs
bsd-3-clause
2,814
0
15
671
1,056
561
495
51
1
-- factoring.hs module Math.Factoring where import List (partition) import Math.MergeSort import Math.NumberTheoryFundamentals (splitWith) import Math.Primes import Math.FactoringECM import Math.FactoringCFRAC -- In tests, ECM comes out faster than CFRAC, but not hugely so. factors n | isPrime n = ...
nfjinjing/bench-euler
src/Math/Factoring.hs
bsd-3-clause
1,214
8
12
290
443
233
210
28
6
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE UndecidableInstances #-} module InputSelection.FromGeneric ( -- * Instantiation of the generic infrastructure DSL , SafeValue(..) , Size(..) , runCoinSelT -- * Wrap coin selection -- ** Random , PrivacyMode(..) , random -- ** Largest-first...
input-output-hk/pos-haskell-prototype
wallet/test/unit/InputSelection/FromGeneric.hs
mit
6,771
0
17
1,521
2,047
1,082
965
-1
-1
{-# OPTIONS -fglasgow-exts #-} module Baum.List ( make_fixed, make_quiz ) where -- $Id$ import Baum.List.Type import Baum.List.Ops import Baum.List.Show import qualified Baum.Heap.Class as C import qualified Baum.Heap.Central import qualified Tree as T import Autolib.ToDoc import Inter.Types import Data.Typeabl...
florianpilz/autotool
src/Baum/List.hs
gpl-2.0
706
0
7
117
189
112
77
-1
-1
{-# LANGUAGE TypeFamilies #-} module Data.TypedGraph.Morphism where -- TODO: write export list explicitly import Data.Function (on) import Data.List (nubBy) import Data.Maybe (fromMaybe, isJust) import Base.Valid import qualified Data.Graphs ...
rodrigo-machado/verigraph
src/library/Data/TypedGraph/Morphism.hs
gpl-3.0
14,053
0
16
2,849
3,420
1,760
1,660
161
3
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} module Foundation.Check.Gen ( Gen , runGen , GenParams(..) , GenRng , genRng , genWithRng , genWithParams ) where import Basement.Imports import ...
vincenthz/hs-foundation
foundation/Foundation/Check/Gen.hs
bsd-3-clause
2,436
0
12
640
732
394
338
58
1
module Tests.Util where import Control.Applicative import qualified Data.Text as T import Graphics.Vty import Graphics.Vty.Widgets.Core import Graphics.Vty.Widgets.Util import Text.Trans.Tokenize import Test.QuickCheck import Test.QuickCheck.Monadic import Tests.Instances () imageSize :: Image -> DisplayRegion -> Boo...
KommuSoft/vty-ui
test/src/Tests/Util.hs
bsd-3-clause
1,221
0
14
279
456
244
212
33
2
{-# OPTIONS -Wall -O2 #-} {-# LANGUAGE OverloadedStrings #-} import Control.Monad import Data.ByteString (empty) import Lib.Binary (decode) import Pretty () import Text.PrettyPrint.HughesPJClass (Pretty(..)) import qualified Buildsome.Db as Db import qualified Control.Exception as E import qualified Database.Sophia as ...
nadavshemer/buildsome
src/EnumDatabase.hs
gpl-2.0
1,189
0
26
300
388
198
190
34
1
{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Thrift.Arbitraries where import Data.Bits() import Test.QuickCheck.Arbitrary #if __GLASGOW_HASKELL__ < 710 import Control.Applicative ((<$>)) #endif import Data.Map (Map) import qualified Data.Map as Map import qualified Data.Set as Set import qualif...
LinusU/fbthrift
thrift/lib/hs/Thrift/Arbitraries.hs
apache-2.0
2,056
0
9
340
463
270
193
34
0
module API where -- simple type type Interface = Int
abuiles/turbinado-blog
tmp/dependencies/hs-plugins-1.3.1/testsuite/pdynload/spj2/api/API.hs
bsd-3-clause
56
0
4
13
11
8
3
2
0
-- (c) The University of Glasgow 2006 {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} module Unify ( tcMatchTy, tcMatchTyKi, tcMatchTys, tcMatchTyKis, tcMatchTyX, tcMatchTysX, tcMatchTyKisX, ruleMatchTyKiX, -- * Rough matching r...
shlevy/ghc
compiler/types/Unify.hs
bsd-3-clause
55,080
25
23
15,657
8,439
4,405
4,034
605
6
{-# LANGUAGE TemplateHaskell, MultiParamTypeClasses #-} -- Copyright (c) 2005-6 Don Stewart - http://www.cse.unsw.edu.au/~dons -- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html) -- | Lambdabot version information module Plugin.Version where import Plugin import Paths_lambdabot (version) import Data....
zeekay/lambdabot
Plugin/Version.hs
mit
715
0
9
156
116
64
52
13
0
<?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>Π‘ΠΊΠ°Π½Π΅Ρ€ ΠΏΠΎΡΠ»Π΅Π΄ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΠΈ | ZAP-Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½ΠΈΠ΅ </title> <maps> <homeID>top</homeI...
thc202/zap-extensions
addOns/sequence/src/main/javahelp/org/zaproxy/zap/extension/sequence/resources/help_ru_RU/helpset_ru_RU.hs
apache-2.0
1,054
78
67
159
534
267
267
-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="ar-SA"> <title>Eval Villain Add-On</title> <maps> <homeID>evalvillain</homeID> <mapref ...
kingthorin/zap-extensions
addOns/evalvillain/src/main/javahelp/org/zaproxy/addon/evalvillain/resources/help_ar_SA/helpset_ar_SA.hs
apache-2.0
972
77
67
157
413
209
204
-1
-1
import Network.XmlRpc.Client import System.Time server = "http://time.xmlrpc.com/RPC2" currentTime :: IO CalendarTime currentTime = remote server "currentTime.getCurrentTime" main = do t <- currentTime putStrLn (calendarTimeToString t)
laurencer/confluence-sync
vendor/haxr/examples/time-xmlrpc-com.hs
bsd-3-clause
253
0
9
42
59
30
29
8
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Main where import Control.Applicative ((<$>)) import Wiki import Yesod -- A very simple App, doesn't do anything except provi...
ygale/yesod
demo/subsite/Main.hs
mit
947
0
8
282
143
81
62
22
1
import Distribution.Simple main :: IO () main = defaultMain -- Although this looks like the Simple build type, it is in fact vital that -- we use this Setup.hs because it'll get compiled against the local copy -- of the Cabal lib, thus enabling Cabal to bootstrap itself without relying -- on any previous installation....
jwiegley/ghc-release
libraries/Cabal/cabal/Setup.hs
gpl-3.0
468
0
6
83
27
17
10
3
1
module Language.Asol.Interpreter where import Control.Monad.State import Language.Asol.Expression import Data.Char (chr) type AsolEvent = StateT Stack IO type Stack = [Integer] stackop :: Int -> AsolEvent () -> AsolEvent () stackop n op = do stack <- get if length stack < n then error "Stack underflo...
kmein/asol
Language/Asol/Interpreter.hs
mit
1,549
0
16
437
708
357
351
45
16
{-# LANGUAGE OverloadedStrings #-} module Data.CSS.Syntax.Tokens ( Token(..) , NumericValue(..) , HashFlag(..) , Unit , tokenize , serialize ) where import Control.Applicative import Control.Monad import Data.Text (Text) import qualified Data.Text as T impo...
bitemyapp/haskell-css-syntax
src/Data/CSS/Syntax/Tokens.hs
mit
12,399
11
28
3,815
4,003
2,021
1,982
369
24
-- | -- Module : System.Hapistrano.Types -- Copyright : Β© 2015-Present Stack Builders -- License : MIT -- -- Maintainer : Cristhian Motoche <cmotoche@stackbuilders.com> -- Stability : experimental -- Portability : portable -- -- Type definitions for the Hapistrano tool. {-# LANGUAGE OverloadedString...
stackbuilders/hapistrano
src/System/Hapistrano/Types.hs
mit
6,187
0
14
1,289
1,137
656
481
137
2
{-# LANGUAGE NamedFieldPuns #-} module Hickory.Camera where import Hickory.Math.Vector import Hickory.Math.Matrix import Linear (V3, lerp, (!*!), perspective, lookAt, ortho) data Projection = Perspective { fov :: Scalar , nearPlane :: Scalar , farPlane :: Scalar } | Ortho { width :: Scalar , near :: Sc...
asivitz/Hickory
Hickory/Camera.hs
mit
1,995
0
12
375
688
375
313
48
2
module QuantumComputer.TeleportEx ( psi , psi0 , psi1 , psi2 , teleportGates , teleportCircuit ) where import QuantumComputer.ConstantStates import QuantumComputer.Gates import QuantumComputer.QStates -- teleportation psi = qstate0 psi0 = psi `combineStates` bell00 psi1 = hgate 0 psi0 psi2 = cnot 0 1 psi1 -- same ...
VictorLoren/quantum-computer-haskell
QuantumComputer/TeleportEx.hs
mit
569
0
7
100
171
95
76
16
1
module Problem28 where {-- Task description: Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows: 21 22 23 24 25 20 7 8 9 10 19 6 1 2 11 18 5 4 3 12 17 16 15 14 13 It can be verified that the sum of the numbers on the diagonals is 1...
runjak/projectEuler
src/Problem28.hs
mit
586
0
10
160
105
58
47
7
1
{-# OPTIONS_GHC -F -pgmF htfpp #-} module Test.Data.SetMultiMap where import Test.Framework import qualified Data.SetMultiMap as SetMultiMap; import Data.SetMultiMap (SetMultiMap) import qualified Data.List as List import qualified Data.Set as Set; import Data.Set (Set) import Control.Applicative prop_replacingRemo...
scravy/multimap
src/Test/Data/SetMultiMap.hs
mit
3,056
0
22
954
936
475
461
-1
-1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} -- | -- -- Generic OAuth2 plugin for Yesod -- -- See @"Yesod.Auth.OAuth2.GitHub"@ for example usage. -- module Yesod.Auth.OAuth2 ( OAuth2(..) , FetchCreds , Manager , OAuth2Token(..) , Creds(..) , o...
thoughtbot/yesod-auth-oauth2
src/Yesod/Auth/OAuth2.hs
mit
3,431
0
11
628
664
375
289
-1
-1
import Data.Ratio calcE :: Int -> Rational calcE n = calcE' 0 where calcE' :: Int -> Rational calcE' i = cur + next where cur | i == 0 = 2 | (i + 1) `mod` 3 == 0 = fromIntegral ((i + 1) `div` 3) * 2 | otherwise = 1 ...
RossMeikleham/Project-Euler-Haskell
65.hs
mit
530
0
15
216
241
128
113
14
2
{-# LANGUAGE BangPatterns, DataKinds, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module Hadoop.Protos.ZKFCProtocolProtos.ZKFCProtocolService (ZKFCProtocolService, zKFCProtocolService, CedeActive, GracefulFailover, cedeActive, gracefulFailover) wh...
alexbiehl/hoop
hadoop-protos/src/Hadoop/Protos/ZKFCProtocolProtos/ZKFCProtocolService.hs
mit
1,679
0
7
155
234
156
78
27
1
module Atbash (decode, encode) where import Data.Char (isLetter, toLower, isAlphaNum) import qualified Data.Text as T import Data.Text (Text) decode :: Text -> Text decode = T.map atbashChar . T.filter isAlphaNum encode :: Text -> Text encode = T.unwords . T.chunksOf 5 . decode atbashChar :: Cha...
exercism/xhaskell
exercises/practice/atbash-cipher/.meta/examples/success-text/src/Atbash.hs
mit
532
0
10
164
174
92
82
16
1
module Golf where import Data.List (group, intercalate, sort, tails, transpose, zip3) import Data.Maybe (fromMaybe) skips :: [a] -> [[a]] skips = map skipper . init . tails . zip [1..] skipper :: Integral a => [(a,b)] -> [b] skipper xs = map snd $ filter p xs where p = (==0) . flip mod n . fst n = fst $ he...
ryanoneill/yorgey-haskell
Week03/Golf.hs
mit
840
0
14
212
429
230
199
20
1
{- parse and work with simple config files. Config files take the form: name1 = It's a beautiful day in the neighborhood. name2 = 40 name3 = 99.123 -} module Croissant ( parseConfigFile , getInt , getFloat ) where import Tea import Parser import Control.Applicative import qualified Data.Map.Strict as Map import ...
ZacharyKamerling/Canvas
src/Croissant.hs
mit
1,111
2
13
232
371
186
185
32
2
fibo n = if n < 2 then n else fibo (n-1) + fibo (n-2) inputList = [19,9,2,16,3,8,0,6,4,17,5,1,14,12,15,13,10,7,11,18] fiboList = map (fibo) inputList main = mapM_ print fiboList
changeworld/fibonacci_race
fibonacci_race.hs
mit
178
0
9
28
133
78
55
4
2
module Y2016.M08.D29.Solution where import Control.Arrow ((&&&), (>>>)) import Data.List (group) import qualified Data.ByteString.Lazy.Char8 as BL import qualified Codec.Compression.GZip as GZ {-- Now for something completely different. My daughter, EM, posed this #math problem to me. Can you solve it? WHAT IS THE...
geophf/1HaskellADay
exercises/HAD/Y2016/M08/D29/Solution.hs
mit
1,323
0
14
229
179
109
70
-1
-1
{-# LANGUAGE TemplateHaskell #-} module Types.Player( Player(..), playerSnippet, alive, moveToEntity ) where import Data.Default import Control.Lens import Data.List(intercalate) import Data.Direction import Types.Consumable import Types.Item import Types.Block import Types.Enemy import Types.Jewel import Type...
5outh/textlunky
src/Types/Player.hs
mit
3,164
0
15
888
1,001
539
462
84
12
module AES256GCMBench (benchAes256GCM, aes256GCMEnv) where import Criterion.Main import Control.Monad import Control.DeepSeq import Control.Exception import Data.ByteString as BS import Crypto.Saltine.Core.AEAD.AES256GCM as G import BenchUtils aes256GCMEnv :: IO Key aes256GCMEnv = newKey benchAes256GCM :: Key -> ...
tel/saltine
bench/AES256GCMBench.hs
mit
2,625
0
16
822
820
401
419
54
1
{- This module was generated from data in the Kate syntax highlighting file haxe.xml, version 0.1, by Chad Joan -} module Text.Highlighting.Kate.Syntax.Haxe (highlight, parseExpression, syntaxName, syntaxExtensions) where import Text.Highlighting.Kate.Types import Text.Highlighting.Kate.Common import Text...
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Haxe.hs
gpl-2.0
7,374
0
29
1,114
1,914
1,017
897
127
9
{-# LANGUAGE MultiWayIf #-} module Amoeba.GameLogic.Language.Parsing.WorldParser where import Amoeba.GameLogic.Language.Parsing.Common import Amoeba.GameLogic.Language.RawToken import qualified Amoeba.GameLogic.Language.Scheme as S import Amoeba.Middleware.Parsing.Facade as P world :: GenParser Char st RawToken wor...
graninas/The-Amoeba-World
src/Amoeba/GameLogic/Language/Parsing/WorldParser.hs
gpl-3.0
2,779
0
12
736
672
323
349
65
5
module Murex.Lexer ( runLexer , Token (..) ) where import Import hiding ((<|>)) import Control.Monad.Either import Murex.Syntax.Abstract (Literal(..)) import qualified Murex.Syntax.Abstract as A import qualified Data.Char as C import Text.Parsec ( Parsec, ParseError, SourceName, runParser ...
Zankoku-Okuno/murex
Murex/Lexer.hs
gpl-3.0
10,617
0
21
3,203
3,357
1,740
1,617
232
17
{-# OPTIONS_GHC -Wall #-} module LexerHelpers where import qualified Data.Set import Grammar -- If word ends with ending, give back Just the word with the ending stripped -- off. If word doesn't end with ending, give back Nothing. getRootFrom :: String -> String -> Maybe String getRootFrom ending word = let r...
penguinland/nlp
LexerHelpers.hs
gpl-3.0
950
0
12
220
299
155
144
23
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE Stand...
merijn/GPU-benchmarks
benchmark-analysis/src/Schema/Implementation.hs
gpl-3.0
2,626
0
11
437
403
246
157
45
1
-- ----------------------------------------------------------------------- -- GOptions, utils for manipulating GNU options for haskell version of GNU core-utils. module GOptions where import Data.List optionDelimiter :: Char optionDelimiter = '-' optionTerminator :: String optionTerminator = "--" paramaterDelimiter :...
PuZZleDucK/Hls
GOptions.hs
gpl-3.0
10,035
0
16
2,412
4,448
2,380
2,068
233
17
{- teafree, a Haskell utility for tea addicts Copyright (C) 2013 Fabien Dubosson <fabien.dubosson@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 t...
StreakyCobra/teafree
src/teafree.hs
gpl-3.0
2,915
0
11
606
544
292
252
46
1
{- Copyright (C) 2014 Aner Lucero 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. This program is distributed in the hope that...
argent0/haskell-learnroad
SolderingRobot/Main.hs
gpl-3.0
1,742
8
14
329
621
338
283
34
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/Get.hs
mpl-2.0
6,003
0
18
1,449
869
508
361
125
1
{-# LANGUAGE TypeSynonymInstances, FlexibleContexts, FlexibleInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, RecursiveDo, TypeFamilies, OverloadedStrings, RecordWildCards,UndecidableInstances, PackageImports, TemplateHaskell #-} module Graphics.Diagrams.Path where import Graphics.Diagrams.Core import Gr...
jyp/lp-diagrams
Graphics/Diagrams/Path.hs
agpl-3.0
7,292
0
13
1,492
3,064
1,629
1,435
146
2
-- construct hbal trees with n nodes (rather than d depth as in Pr59) module Pr60 where import Tree (Tree(Branch, Empty), nnodes) import Pr59 (is_hbal, all_trees_and_smaller) hbal :: a -> Int -> [Tree a] hbal x n = filter is_hbal [t | t <- all_trees_and_smaller n x, nnodes t == n]
ekalosak/haskell-practice
Pr60.hs
lgpl-3.0
284
0
9
53
94
53
41
5
1
import Diff import System.Environment main = do args <- getArgs a <- readFile (head args) b <- readFile (head $ tail args) let zz = diff (lines a) (lines b) putStr $ concatMap show zz
sourcewave/pg-schema-diff
TestDiff.hs
unlicense
197
0
12
48
95
44
51
8
1
import System.Exit main :: IO () main = exitWith ExitSuccess
iustin/perf-null
haskell/null.hs
apache-2.0
61
0
6
10
24
12
12
3
1
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} -- | -- -- OAuth2 plugin for http://upcase.com -- -- * Authenticates against upcase -- * Uses upcase user id as credentials identifier -- * Returns first_name, last_name, and email as extras -- module Yesod.Auth.OAuth2.Upcase ( oauth2Upcase , module Yesod....
jasonzoladz/yesod-auth-oauth2
Yesod/Auth/OAuth2/Upcase.hs
bsd-2-clause
2,018
0
13
514
411
241
170
49
1
import NLP.General import NLP.Crubadan import NLP.Freq import NLP.Tools import System.IO (hPutStrLn, stderr) import Options.Applicative import Control.Exception (evaluate) import Control.Monad import qualified Data.Text as T import qualified Data.List as L import qualified Data.Set as S import qualified Data.Map.Stri...
RoboNickBot/nlp-tools
src/Wrident.hs
bsd-2-clause
3,871
0
14
1,344
1,168
604
564
91
1
{- | Module : Codec.Goat Description : Top-level module file (intended for import) Copyright : (c) Daniel Lovasko, 2016-2017 License : BSD3 Maintainer : Daniel Lovasko <daniel.lovasko@gmail.com> Stability : stable Portability : portable Goat is a time series compression implementation in pure Haskell. I...
lovasko/goat
src/Codec/Goat.hs
bsd-2-clause
690
0
5
106
72
49
23
15
0
module Data.IORef.RunOnce (runOnce) where import Control.Monad.IO.Unlift import Data.IORef runOnce :: (MonadUnliftIO m, MonadIO n) => m a -> m (n a) runOnce f = withRunIO $ \runIO -> do ref <- newIORef Nothing return $ liftIO $ do mval <- readIORef ref case mval of Just val -> retu...
martin-kolinek/stack
src/Data/IORef/RunOnce.hs
bsd-3-clause
453
0
19
161
163
79
84
14
2
import System.Environment (getArgs) cardinal :: [Int] -> String cardinal [x1, y1, x2, y2] | x1 == x2 = if y1 == y2 then "here" else if y1 < y2 then "N" else "S" | y1 == y2 = if x1 < x2 then "E" else "W" | x1 < x2 = if y1 < y2 then "NE" else "SE" ...
nikai3d/ce-challenges
easy/compare_points.hs
bsd-3-clause
541
0
13
210
218
113
105
11
6
module Numeric.MaxEnt.Internal ( --module Numeric.MaxEnt.ConjugateGradient, module Numeric.MaxEnt.General, module Numeric.MaxEnt.Moment, module Numeric.MaxEnt.Linear ) where --import Numeric.MaxEnt.ConjugateGradient import Numeric.MaxEnt.General import Numeric.MaxEnt.Moment import N...
jfischoff/maxent
src/Numeric/MaxEnt/Internal.hs
bsd-3-clause
342
0
5
59
50
35
15
7
0
-------------------------------------------------------------------- -- | -- Module : Data.MessagePack.Feed -- Copyright : (c) Hideyuki Tanaka, 2009 -- License : BSD3 -- -- Maintainer: tanaka.hideyuki@gmail.com -- Stability : experimental -- Portability: portable -- -- Feeders for Stream Deserializers -- -------...
tanakh/hsmsgpack
src/Data/MessagePack/Feed.hs
bsd-3-clause
1,370
0
11
265
282
151
131
31
2
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.NV.VertexProgram4 -- Copyright : (c) Sven Panne 2013 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -...
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/NV/VertexProgram4.hs
bsd-3-clause
1,247
0
4
183
108
79
29
26
0
{-# LANGUAGE NoImplicitPrelude #-} module Protocol.ROC.PointTypes.PointType44 where import Data.Binary.Get (getByteString,getWord32le,Get) import Data.ByteString (ByteString) import Data.Int (Int16) import Data.Word (Word32) import Prelude (($), return, ...
plow-technologies/roc-translator
src/Protocol/ROC/PointTypes/PointType44.hs
bsd-3-clause
5,042
0
9
2,586
591
331
260
120
1
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, PatternGuards #-} module Idris.Core.Evaluate(normalise, normaliseTrace, normaliseC, normaliseAll, rt_simplify, simplify, specialise, hnf, convEq, convEq', Def(..), CaseInfo(..), CaseDefs(..), Accessibili...
DanielWaterworth/Idris-dev
src/Idris/Core/Evaluate.hs
bsd-3-clause
42,818
5
29
16,356
15,232
7,787
7,445
766
79
{-# LANGUAGE MonadComprehensions #-} {-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE OverloadedStrings #-} -- | Top-K queries (flat and nested) over the TPC-H schema. module Queries.TPCH.NonStandard.TopK where import Prelude() import Database.DSH import Schema.TPCH import Queries.TPCH.BuildingBlocks -- | Report...
ulricha/dsh-tpc-h
Queries/TPCH/NonStandard/TopK.hs
bsd-3-clause
2,431
0
12
585
709
384
325
43
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.NV.TextureRectangle -- Copyright : (c) Sven Panne 2013 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable...
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/NV/TextureRectangle.hs
bsd-3-clause
786
0
4
98
47
38
9
6
0
module Web.Leo.Types where import Network.HTTP(urlEncode) data Language = En | Fr | Es | It | Ch | Ru | Pt | Pl | De | Unknown deriving (Eq) -- |For simple parsing of Language from XML we use the Read class. instance Read Language where readsPrec _ value = tryParse langs where langs = [("en...
krgn/leo
src/Web/Leo/Types.hs
bsd-3-clause
2,448
0
13
866
714
419
295
68
1
module Main where import GameCard import Player import Game import Card import System.IO import Data.Char (isDigit, isSpace) import Data.IORef (newIORef, readIORef, writeIORef, IORef) import Control.Monad (liftM2) data GState = GState {gamecard :: GameCard, cplayer :: Int ,ctime :: Int} ...
Raynes/Hricket
src/Main.hs
bsd-3-clause
3,123
0
21
924
1,156
567
589
82
3
{-# LANGUAGE QuasiQuotes #-} {-@ LIQUID "--no-termination "@-} {-@ LIQUID "--short-names "@-} import LiquidHaskell import Language.Haskell.Liquid.Prelude (liquidError) import Data.Vector import Data.Vector.Mutable (write) import Prelude hiding (length, replicate) [lq| type Idx X = {v:Nat | v < vlen X} |] searc...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/kmpVec.hs
bsd-3-clause
1,820
5
10
670
525
268
257
37
1
import Text.Printf (printf) v = 20.0 :: Double g = 9.81 :: Double y_min = -100.0 :: Double y_max = v * v / 2 / g f y = pi * v4 / g2 * y - pi * v2 / g * y * y where v2 = v * v v4 = v2 * v2 g2 = g * g main = printf "%.4f\n" $ f y_max - f y_min
foreverbell/project-euler-solutions
src/317.hs
bsd-3-clause
259
8
11
90
178
79
99
10
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. {-# LANGUAGE Deri...
rfranek/duckling
Duckling/Distance/Types.hs
bsd-3-clause
1,648
0
10
317
378
220
158
45
0
-- -- Debug.hs -- -- Display functions calls, arguments and results. -- -- Gregory Wright, 12 June 2011 -- module Math.Symbolic.Wheeler.Debug where import Debug.Trace traceCall :: (Show a, Show b) => String -> (a -> b) -> a -> b traceCall msg fn arg = let retval = fn arg in trace (msg ...
gwright83/Wheeler
src/Math/Symbolic/Wheeler/Debug.hs
bsd-3-clause
1,853
0
17
948
594
299
295
52
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Choice (choice2maybe, Choicest (..), depends, unchoice) where import Data.Semigroup class Choice a where (<|||>) :: a -> a -> a firstCorrect :: Choice a => [a] -> a firstCorrect = foldr1 (<|||>) instance Choice b => Choice (a -> b) where f <|||> g = \x -> f x <|...
sejdm/smartWallpaper
src/Choice.hs
bsd-3-clause
837
0
9
170
364
192
172
22
1
{-# LANGUAGE ForeignFunctionInterface #-} -- | -- Module : System.Posix.LoadAvg -- There are two basic ways you can get load average on a modern Linux system. -- First is @getloadavg (3)@ system call. The second is @\/proc\/loadavg@ file. -- This module provides means of getting the information from both sources....
Tener/haskell-loadavg
src/System/Posix/LoadAvg.hs
bsd-3-clause
2,419
0
15
677
428
228
200
39
4
module JDec.Class.Raw.ClassVersion ( ClassVersion(ClassVersion), minorClassVersion, majorClassVersion ) where -- | The values of the minorVersion and majorVersion items are the minor and major version numbers of the class file. Together, a major and a minor version number determine the version of the class file forma...
rel-eng/jdec
src/JDec/Class/Raw/ClassVersion.hs
bsd-3-clause
651
0
8
108
50
34
16
10
0
{-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- | -- Module : System.Taffybar.DBus.Toggle -- Copyright : (c) Ivan A. Malison -- License : BSD3-style (see LICENSE) -- -- Maintainer : Ivan A. Malison -- Stability : unstable -- Portability :...
teleshoes/taffybar
src/System/Taffybar/DBus/Toggle.hs
bsd-3-clause
6,556
2
23
1,480
1,462
744
718
130
4
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariabl...
zerobuzz/regex-easy
Text/Regex/Easy.hs
bsd-3-clause
4,863
0
18
1,630
1,290
746
544
81
3
module .Internal ( ) where
KevinCotrone/JIT-Compiled
src/Internal.hs
bsd-3-clause
35
1
3
13
9
6
3
-1
-1
{- (c) The University of Glasgow 2006 (c) The AQUA Project, Glasgow University, 1993-1998 TcRules: Typechecking transformation rules -} {-# LANGUAGE ViewPatterns #-} module TcRules ( tcRules ) where import HsSyn import TcRnMonad import TcSimplify import TcMType import TcType import TcHsType import TcExpr import Tc...
gridaphobe/ghc
compiler/typecheck/TcRules.hs
bsd-3-clause
14,444
2
17
4,430
1,636
847
789
133
3
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} module Network.Wai.Handler.Warp.Types where import Control.Exception import Data.ByteString (ByteString) import qualified Data.ByteString as S import Data.IORef (IORef, readIORef, writeIORef, newIORef) import Data.Typeable (Ty...
jberryman/wai
warp/Network/Wai/Handler/Warp/Types.hs
mit
4,807
0
15
1,025
850
483
367
91
2
module PatternMatchBug4 where main = f ["a", "a"] f ["a", x] = x
roberth/uu-helium
test/correct/PatternMatchBug4.hs
gpl-3.0
70
0
6
18
32
19
13
3
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/CreateTags.hs
mpl-2.0
3,784
0
10
855
479
293
186
56
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Controller ( withWiki , withDevelApp ) where import Wiki import Settings import Yesod.Static import Yesod.Auth import Database.Persist.GenericSql import Da...
snoyberg/yesoddocs
Controller.hs
bsd-2-clause
1,994
0
12
293
366
204
162
45
1
{-# LANGUAGE ViewPatterns #-} module Main ( main ) where import Data.Map ( Map ) import qualified Data.Map as M import Data.Monoid import System.Environment ( getArgs, withArgs ) import System.FilePath import Test.HUnit ( assertEqual ) import LLVM.Analysis import LLVM.Analysis.BlockReturnValue import LLVM.Analysis.Do...
travitch/llvm-analysis
tests/BlockReturnTests.hs
bsd-3-clause
2,110
0
14
560
534
286
248
49
3
-- (c) The University of Glasgow 2006 {-# LANGUAGE CPP #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE BangPatterns #-} #if __GLASGOW_HASKELL__ < 800 -- For CallStack business {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE FlexibleContexts #-} #endif -- | Highly random utility function...
olsner/ghc
compiler/utils/Util.hs
bsd-3-clause
46,037
0
19
13,496
11,522
6,303
5,219
663
7
{-# LANGUAGE OverloadedStrings,RecordWildCards #-} module Stack.Options (Command(..) ,benchOptsParser ,buildOptsParser ,cleanOptsParser ,configCmdSetParser ,configOptsParser ,dockerOptsParser ,dockerCleanupOptsParser ,dotOptsParser ,execOptsParser ,evalOptsParser ,global...
rubik/stack
src/Stack/Options.hs
bsd-3-clause
31,439
1
32
11,807
5,696
2,828
2,868
709
9
-- |Part of the General MIDI specs. module GM ( gmInstrumentByNumber , gmInstrumentByName , gmInstrumentList , gmPercussionByKey , gmPercussionByName , gmPercussionList , gm1ControllerList ) where import qualified Data.Map as Map swap :: (a,b) -> (b,a) swap (x,y) = (y,x) -- |Map of ...
sixohsix/hmidi
examples/GM.hs
bsd-3-clause
6,720
0
6
2,004
1,932
1,276
656
212
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} -- | Genera...
MichielDerhaeg/stack
src/Stack/Build/Haddock.hs
bsd-3-clause
13,062
0
29
4,380
2,612
1,342
1,270
265
6
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Data/ByteString/Short.hs" #-} {-# LANGUAGE CPP #-} {-# LANGUAGE Trustworthy #-} -- | -- Module : Data.ByteString.Short -- Copyright : (c) Duncan Coutts 2012-2013 -- License : BSD-style -- -- Maintainer : duncan@co...
phischu/fragnix
tests/packages/scotty/Data.ByteString.Short.hs
bsd-3-clause
3,063
0
4
763
116
100
16
13
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-autoscaling/gen/Network/AWS/AutoScaling/SuspendProcesses.hs
mpl-2.0
4,178
0
10
816
410
254
156
54
1
----------------------------------------------------------------------------- -- -- Object-file symbols (called CLabel for histerical raisins). -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module CLabel ( CLabel, -- abstract type...
holzensp/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
48,062
0
16
13,583
9,481
5,001
4,480
729
21
module DerivingUtils( TypeInfo(..),DefTy(..),ConInfo(..),HsIdentI(..),IdTy(..), idTy,idName, fun,alt1,alt2,fun0,alt1',alt2', vars,app,apps,opapp,con,var,ident,wild,(-::),str,pair, hsLet,hsPApp,hsTyId,hsLit,hsPLit,HsLiteral(..),hsListComp,HsStmt(..), oneDef,toDefs,noDef,localVal, getBaseName,...
forste/haReFork
tools/base/transforms/Deriving/DerivingUtils.hs
bsd-3-clause
2,164
2
11
382
844
480
364
51
1
{-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeFamilies #-} module T15568 where import Data.Proxy type family F (a :: j) :: k
sdiehl/ghc
testsuite/tests/ghci/scripts/T15568.hs
bsd-3-clause
125
0
6
23
26
18
8
5
0
module T13847A where data A = A { foo :: () }
shlevy/ghc
testsuite/tests/rename/should_fail/T13847A.hs
bsd-3-clause
46
0
9
12
21
13
8
2
0
{-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleContexts, DatatypeContexts #-} module ShouldCompile where import Data.Foldable import Data.Traversable data Trivial a = Trivial deriving (Functor,Foldable,Traversable) -- lots of different things da...
urbanslug/ghc
testsuite/tests/deriving/should_compile/drv-foldable-traversable1.hs
bsd-3-clause
923
0
10
188
294
176
118
24
0
module RedBlack where data Color = Red | Black deriving (Eq, Show) data RedBlackTree a = Empty | Node { value :: a , color :: Color , left :: RedBlackTree a , right :: RedBlackTree a } deri...
dstruthers/RedBlack
RedBlack.hs
mit
3,611
0
12
975
1,774
919
855
60
3
module Main where import Data.Char import Data.List import System.Console.GetOpt import System.Directory import System.Environment import System.Exit import System.IO import Text.Printf import Interpreter main = do path <- getArgs >>= parse code <- readFile path runBrainfuckSource code -- Command line argument pa...
chrisrosset/bf.hs
BF.hs
mit
929
10
15
159
307
159
148
30
3
{-# htermination eltsFM_GE :: FiniteMap () b -> () -> [b] #-} import FiniteMap
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/FiniteMap_eltsFM_GE_2.hs
mit
79
0
3
14
5
3
2
1
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MultiWayIf #-} module RWPAS.Control.BeastFrog ( BeastFrogState() ) where import Control.Applicative import Control.Lens import Control.Monad import Control.Monad.Prim...
Noeda/rwpas
src/RWPAS/Control/BeastFrog.hs
mit
4,508
0
28
1,229
1,084
543
541
-1
-1
module Triangle ( TriangleType(..) , triangleType ) where data TriangleType = Equilateral | Illogical | Isosceles | Scalene deriving (Eq, Show) triangleType :: Real a => a -> a -> a -> TriangleType triangleType a b c | isIllogical = Illogic...
tfausak/exercism-solutions
haskell/triangle/Triangle.hs
mit
607
0
11
230
226
121
105
17
1
{-# LANGUAGE DataKinds #-} import Control.Monad.Trans import Options.Declarative main' :: Flag "b" '["bool"] "STRING" "boolean flag" Bool -> Cmd "Simple greeting example" () main' b = liftIO $ putStrLn $ if get b then "Flag is True" else "Flag is False" main :: IO () main = run_ main'
tanakh/optparse-declarative
example/bool.hs
mit
319
0
8
82
90
47
43
9
2
{-# htermination foldFM_LE :: Ord a => ([a] -> b -> c -> c) -> c -> [a] -> FiniteMap [a] b -> c #-} import FiniteMap
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/FiniteMap_foldFM_LE_4.hs
mit
117
0
3
27
5
3
2
1
0
module Solar.Utility.Wait where import System.Timeout import Control.Concurrent import Control.Concurrent.STM type WaitOn = MVar () sleepOn :: () => WaitOn -- ^ Waiting variable -> Int -- ^ Time to sleep in microseconds -> IO () -- ^ Blocking action sleepOn w i = do tryTakeMVar w -- Clear...
Cordite-Studios/solar
solar-wind/Solar/Utility/Wait.hs
mit
835
0
12
277
211
108
103
24
1
import Data.Char nums = map digitToInt "73167176531330624919225119674426574742355349194934\ \96983520312774506326239578318016984801869478851843\ \85861560789112949495459501737958331952853208805511\ \12540698747158523863050715693290963295227443043557\ ...
adsmit14/haskell
ProjectEuler/8.hs
mit
1,768
0
11
523
132
68
64
8
1