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
----------------------------------------------------------------------------- -- | -- License : BSD-3-Clause -- Maintainer : Oleg Grenrus <oleg.grenrus@iki.fi> -- -- The repo collaborators API as described on -- <http://developer.github.com/v3/repos/collaborators/>. module GitHub.Endpoints.Repos.Collaborators ( ...
jwiegley/github
src/GitHub/Endpoints/Repos/Collaborators.hs
bsd-3-clause
2,278
0
10
402
384
209
175
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE MultiWayIf #-} module Hans.Dns.Packet ( DNSPacket(..) , DNSHeader(..) , OpCode(..) , RespCode(..) , Query(..) , QClass(..) , QType(..) , RR(..) , Type(..) , Class(..) , RData(..) ,...
GaloisInc/HaNS
src/Hans/Dns/Packet.hs
bsd-3-clause
18,069
0
21
6,944
4,997
2,504
2,493
482
20
module PCP.Patch where import PCP.Type import PCP.Form import PCP.Examples import Autolib.Util.Wort import Control.Monad -- | rectangular area (no wrap-around) type Patch c = ([c], [Int] ,[c]) patches :: PCP Char -> Int -- ^ depth (max) -> Int -- ^ width (max, at start and end) -> [ Patch Char ] p...
Erdwolf/autotool-bonn
src/PCP/Patch.hs
gpl-2.0
980
35
10
320
436
239
197
36
1
import System.Process.Extra main = system_ "bake-test"
capital-match/bake
travis.hs
bsd-3-clause
57
0
5
8
15
8
7
2
1
module EnvSpec (main, spec) where import TestUtil import Network.MPD import System.Posix.Env hiding (getEnvDefault) main :: IO () main = hspec spec spec :: Spec spec = do describe "getEnvDefault" $ do it "returns the value of an environment variable" $ do setEnv "FOO" "foo"...
beni55/libmpd-haskell
tests/EnvSpec.hs
mit
2,706
0
18
756
733
346
387
64
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="hr-HR"> <title>Core Language Files | ZAP Extension</title> <maps> <homeID>top</homeID> ...
kingthorin/zap-extensions
addOns/coreLang/src/main/javahelp/org/zaproxy/zap/extension/coreLang/resources/help_hr_HR/helpset_hr_HR.hs
apache-2.0
980
78
66
160
415
210
205
-1
-1
{-# LANGUAGE TupleSections #-} import CoreSyn import CoreUtils import Id import Type import MkCore import CallArity (callArityRHS) import MkId import SysTools import DynFlags import ErrUtils import Outputable import TysWiredIn import Literal import GHC import Control.Monad import Control.Monad.IO.Class import System.En...
green-haskell/ghc
testsuite/tests/callarity/unittest/CallArity1.hs
bsd-3-clause
9,333
0
25
2,811
4,143
2,280
1,863
195
2
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Foreign.Concurrent -- Copyright : (c) The University of Glasgow 2003 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintaine...
ezyang/ghc
libraries/base/Foreign/Concurrent.hs
bsd-3-clause
2,940
0
9
536
174
119
55
14
1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Hpc -- Copyright : Thomas Tuegel 2011 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This module provides functions for locating various HPC-r...
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/Distribution/Simple/Hpc.hs
bsd-3-clause
5,350
0
14
1,414
1,041
553
488
100
3
module Thread ( ThreadTree (..) , ContM (..) , atom , stop , buildThread ) where ---------------------------------- data ThreadTree req rsp m = Atom (m (ThreadTree req rsp m)) | Stop ---------------------------------- newtype ContM req rsp m a = ContM ((a-> ThreadTree req rsp m)-> ThreadTree req rsp m)...
ezyang/ghc
testsuite/tests/concurrent/prog002/Thread.hs
bsd-3-clause
1,155
0
15
264
526
279
247
29
1
import qualified Graphics.UI.GLFW as GLFW import Graphics.GL import Data.Bits import Control.Monad import Linear import SetupGLFW import ShaderLoader import Cube ------------------------------------------------------------- -- A test to make sure our rendering works without the Oculus -------------------------------...
lukexi/oculus-mini
test/TestCube.hs
mit
1,441
0
14
348
388
199
189
31
1
import Control.Monad.Trans.State.Lazy tick :: State Int String tick = return "foo" tick2 :: State Int String tick2 = do s <- tick return $ s ++ "bar" tick3 = do s <- tick s2 <- tick2 s3 <- tick2 put 1600 return $ s3 type Stack = [Int] pop :: State Stack Int ...
nlim/haskell-playground
src/Statements.hs
mit
620
0
9
285
245
115
130
26
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} -- module module Persistence (loadSession, saveSession) where -- imports import Control.Applicative import Control.Monad.Error import Control.Monad.State import ...
nicuveo/RCL
src/Persistence.hs
mit
2,461
0
14
617
725
365
360
60
1
data Way = U | R | D | L deriving(Eq, Show) data Op = Op { opPiece :: Int , opCost :: Int , opWay :: [Way] } deriving(Eq, Show) type Field = [Int] swapCost = 1 choiceCost = 10 fieldWidth = 4 fieldHeight = 4 maxChoice = 3 magicNum = 0 goal = [0..24] :: [Int] fie = 1:2:0:[3..24] :: [Int] solv...
inct-www-club/Procon2014
src/solver.hs
mit
3,874
0
14
1,116
1,970
1,023
947
104
5
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} -- for the client: export those types needed for playnow module Game.Play.Api.Types where import Control.Lens.TH (makeLenses) import Data.Aeson (FromJSON, ToJSON...
rubenmoor/skull
skull-server/src/Game/Play/Api/Types.hs
mit
1,138
0
9
268
260
149
111
31
0
module ProjectEuler.Problem56 ( problem ) where import Data.List import ProjectEuler.Types problem :: Problem problem = pureProblem 56 Solved result digitSum :: Integer -> Int digitSum = sum . unfoldr f where f 0 = Nothing f n = let (q,r) = n `quotRem` 10 in Just (fromIntegral r, q) result :: Int resu...
Javran/Project-Euler
src/ProjectEuler/Problem56.hs
mit
389
0
11
85
168
91
77
12
2
-- | <http://strava.github.io/api/v3/activities/> module Strive.Actions.Activities ( createActivity , getActivity , updateActivity , deleteActivity , getCurrentActivities , getRelatedActivities , getFeed , getActivityZones , getActivityLaps ) where import Data.Aeson (encode) import Data.ByteString....
tfausak/strive
source/library/Strive/Actions/Activities.hs
mit
4,194
0
16
638
964
521
443
96
2
module Data.Bson.Binary.Tests ( tests ) where import Data.Binary (encode, decode) import Test.Tasty (TestTree, testGroup) import Test.Tasty.QuickCheck (testProperty) import Data.Bson (Document) import Data.Bson.Binary () import Data.Bson.Tests.Instances () testEncodeDecodeDocument :: Document -> Bool testEn...
lambda-llama/bresson
tests/Data/Bson/Binary/Tests.hs
mit
515
0
7
74
135
80
55
13
1
{-# LANGUAGE DeriveGeneric #-} module Test.SimpleTable where import DB.Model.SimpleTable import qualified DB.Model.SimpleTable as S import DB.Model.MultiTable (MultiTable) import qualified DB.Model.MultiTable as M import Test.Hspec data Test m = Test { key :: m Int, f :: m String, c :...
YLiLarry/db-model
test/Test/SimpleTable.hs
mit
837
0
18
266
261
150
111
28
1
module LispLovesMe where import Text.ParserCombinators.Parsec hiding (spaces) import Data.List (intercalate) data AST = I32 Int | Sym String | Nul | Err | Lst [AST] | Boo Bool | Nod AST [AST] deriving (Eq, Show) spaces :: Parser String spa...
delta4d/codewars
kata/i-love-lisp/LispLovesMe.hs
mit
4,742
0
14
2,031
1,874
959
915
142
4
{-# LANGUAGE OverloadedStrings #-} module System.PassengerCheck.HealthSpec (spec) where import Test.Hspec import System.PassengerCheck.Types import System.PassengerCheck.Health import System.Nagios.Plugin (CheckStatus(..)) spec :: Spec spec = do describe "queuedRequests" $ it "returns the number of queued re...
stackbuilders/passenger-check
spec/System/PassengerCheck/HealthSpec.hs
mit
906
0
15
203
238
131
107
21
1
{- | Module : Main Copyright : Justin Ethier Licence : MIT (see LICENSE in the distribution) Maintainer : github.com/justinethier Stability : experimental Portability : portable This file implements a REPL /shell/ to host the interpreter, and also allows execution of stand-alone files containing Scheme ...
justinethier/husk-scheme
hs-src/Interpreter/shell.hs
mit
7,473
0
26
2,185
1,860
949
911
158
7
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module Api.MimeTypes ( Markdown ) where import qualified Data.ByteString.Lazy as LBS import Data.Text (Text) import Data.Text.Encoding (encodeUtf8) import Network.HTTP.Media ((//), (/:)) import Servant as S data Markdown instance S.Accept Mar...
gust/feature-creature
legacy/lib/Api/MimeTypes.hs
mit
497
0
8
73
134
81
53
-1
-1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.HTMLInputElement (js_stepUp, stepUp, js_stepDown, stepDown, js_checkValidity, checkValidity, js_setCustomValidity, setCustomValidity, js_select, select, js_setRangeText, setRangeText, js_set...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/HTMLInputElement.hs
mit
47,804
708
11
7,604
9,559
4,992
4,567
694
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-version.html module Stratosphere.Resources.ElasticBeanstalkApplicationVersion where import Stratos...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/ElasticBeanstalkApplicationVersion.hs
mit
3,311
0
15
307
364
210
154
37
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE...
paul-rouse/yesod-auth-hashdb
test/TestSite.hs
mit
4,580
0
17
1,327
722
394
328
84
1
module Problem02 (partA, partB) where import Data.Monoid import Text.Megaparsec import Text.Megaparsec.String inputLocation :: FilePath inputLocation = "input/input02.txt" data Offset = Negative | Neutral | Positive deriving (Eq,Show,Enum,Ord) instance Monoid Offset where mempty = Neutral mappend Negati...
edwardwas/adventOfCodeTwo
src/Problem02.hs
mit
3,402
0
14
771
1,387
722
665
81
3
{-# LANGUAGE TypeSynonymInstances #-} module Tasks.Cli.Types ( SerProject (..) , serProj , serProjIndices , serProjProject , unserProj , serProjects , unserProjects , exSerProject , DBFormat(..) , exDBFormat , dbFormatSave , (^||^) , (^&&^) ) where import Co...
BigEndian/tasks
tasks-cli/Tasks/Cli/Types.hs
gpl-2.0
4,077
0
11
890
1,143
606
537
90
2
{- Trabalho 2 Resp.: Rodrigo Ferreira Guimarães Disc.: Linguaguem de Programação Orie.: Rodrigo Bonifácio Func.: Corpo de prova para a linguaguem F6LAE desenvolvida. -} module F6LAE_Tst where {- Módulos necessários para a realização dos testes -} import Test.HUnit import F6LAE {- Traduções semânt...
rodrigofegui/UnB
2017.2/Linguagens de Programação/Trab 2/F6LAE_Tst.hs
gpl-3.0
3,662
0
15
1,233
1,327
685
642
68
1
{-# LANGUAGE OverloadedStrings #-} import Hakyll main :: IO () main = hakyll $ do match "assets/**" $ do route idRoute compile copyFileCompiler match ("about.markdown" .||. "contact.markdown") $ do route $ setExtension "html" compile $ pandocCompiler >>= loadAndApplyTemplat...
Vincibean/Vincibean.github.io
site/site.hs
gpl-3.0
1,794
0
22
435
399
182
217
51
1
{---------------------------------------------------------------------} {- Copyright 2015 Nathan Bloomfield -} {- -} {- This file is part of Feivel. -} {- ...
nbloomf/feivel
src/Feivel/Eval/Expr.hs
gpl-3.0
2,653
0
9
906
608
311
297
45
0
{-# LANGUAGE OverloadedStrings #-} import Control.Monad import Control.Applicative import Data.Text (Text) import qualified Data.Text.Lazy as DTL import HSH (run) import Network.Mail.Client.Gmail (sendGmail) import Network.Mail.Mime import System.Environment (getArgs) import Data.String.Utils (split) import GetPara...
manojgudi/email_builds
email_build.hs
gpl-3.0
2,671
0
17
504
717
365
352
42
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-logging/gen/Network/Google/Resource/Logging/Projects/Locations/Operations/List.hs
mpl-2.0
7,535
0
19
1,667
984
575
409
141
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/OperatingSystems/List.hs
mpl-2.0
3,077
0
13
675
320
194
126
52
1
{-# LANGUAGE OverloadedStrings, TypeFamilies #-} module Model.Slot.Types ( SlotId(..) , Slot(..) , slotId , containerSlotId , containerSlot , getSlotReleaseMaybe ) where import Has (Has(..)) import Model.Id import Model.Kind import Model.Segment import Model.Container.Types import Model.Permission.Types ...
databrary/databrary
src/Model/Slot/Types.hs
agpl-3.0
1,496
0
11
256
431
240
191
-1
-1
-- -*-haskell-*- -- GIMP Toolkit (GTK) Widget Scrollbar -- -- Author : Axel Simon -- -- Created: 15 May 2001 -- -- Copyright (C) 1999-2005 Axel Simon -- -- 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 the Fr...
thiagoarrais/gtk2hs
gtk/Graphics/UI/Gtk/Abstract/Scrollbar.hs
lgpl-2.1
2,370
0
5
479
99
85
14
7
0
module HEP.Jet.FastJet.Class.GhostedAreaSpec where
wavewave/HFastJet
oldsrc/HEP/Jet/FastJet/Class/GhostedAreaSpec.hs
lgpl-2.1
53
0
3
5
9
7
2
1
0
import Test.HUnit import P9x.P00.P00_ import Data.List(nub) import System.Random(setStdGen, mkStdGen) import P9x.Util(doExpectEqual) main :: IO Counts main = do (\f -> doExpectEqual "P01" 8 (f [1, 1, 2, 3, 5, 8])) `mapM_` [myLast', myLast'', myLast''', myLast'''', myLast'''''] (\f -> doExpectEqual "P...
dkandalov/katas
haskell/p99/src/p9x/p00/P00_Test.hs
unlicense
9,449
0
19
2,181
3,686
2,068
1,618
145
1
module TrmX_ActionsTest where import Test.Hspec import TrmX import TrmX_Actions import qualified Data.Map as M import qualified Data.Set as S main :: IO () main = hspec $ do describe "TrmX_Actions" $ do describe "prmComp" $ do it "returns a composition of a pair of permutations p1 p2 such that p1.p2 an...
susoDominguez/eNominalTerms-Alpha
TrmX_ActionsTest.hs
unlicense
3,470
0
30
795
1,292
716
576
46
1
-- (**) Rotate a list N places to the left. -- -- Hint: Use the predefined functions length and (++). -- -- Examples: -- -- * (rotate '(a b c d e f g h) 3) -- (D E F G H A B C) -- -- * (rotate '(a b c d e f g h) -2) -- (G H A B C D E F) -- Examples in Haskell: -- -- *Main> rotate ['a','b','c','d','e','f','g','h'] 3 -- ...
tiann/haskell-learning
haskell99/p19/main.hs
apache-2.0
561
0
9
138
104
59
45
5
1
module Problem063 where main = print $ length [n | b <- [1 .. 9], p <- ps, let n = b ^ p, length (show n) == p] where ps = takeWhile (\p -> length (show (9 ^ p)) >= p) [1 ..]
vasily-kartashov/playground
euler/problem-063.hs
apache-2.0
181
0
15
50
116
62
54
4
1
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} import Data.List class Foo a where foo :: a -> String -- Now will error due to the compiler don't know which one to call between -- String and [char] instance (Foo a) => Foo [a] where foo = concat . intersperse ", " . map foo instance Foo Char where ...
EricYT/Haskell
src/chapter-6-4.hs
apache-2.0
375
0
8
88
98
52
46
10
0
-------------------------------------------------------------------------------- -- | -- Module : Network.SimpleIRC.Core.Lens -- Copyright : (C) 2014 Ricky Elrod -- License : BSD-style (see the file LICENSE) -- Maintainer : Ricky Elrod <ricky@elrod.me> -- Stability : provisional -- Portability : por...
relrod/simpleirc-lens
src/Network/SimpleIRC/Core/Lens.hs
bsd-2-clause
3,054
0
11
781
1,475
748
727
55
1
import Prelude data Encoded a = Single a | Multiple Int a deriving Show encodeDirect :: Eq a => [a] -> [Encoded a] encodeDirect [] = [] encodeDirect xs = foldr (append) [] xs where append y [] = [Single y] append y ((Single z):zs) | (y == z) = (Multiple 2 z):zs | otherw...
2dor/99-problems-Haskell
11-20-lists-continued/problem-13.hs
bsd-2-clause
492
0
12
163
266
135
131
13
3
{-# LANGUAGE OverloadedStrings, ViewPatterns #-} import qualified Prelude as P import BasicPrelude import Filesystem.Path.CurrentOS (decodeString) import System.Environment (getArgs) import qualified Data.Text.Encoding as T import qualified Data.Ini.Reader as Ini import Data.Conduit.Network (runTCPServer, serverSettin...
yihuang/cloud-ftp
Main.hs
bsd-3-clause
715
0
12
89
175
106
69
17
1
{-# LANGUAGE KindSignatures #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE TypeOperators...
jonascarpay/visor
src/Types.hs
bsd-3-clause
5,061
0
13
1,176
1,729
923
806
103
0
-- | -- Module : Language.Logo -- Copyright : (c) 2013-2016, the HLogo team -- License : BSD3 -- Maintainer : Nikolaos Bezirgiannis <bezirgia@cwi.nl> -- Stability : experimental -- -- Main wrapper module; the only module that should be imported by the model module Language.Logo ( module Lan...
bezirg/hlogo
src/Language/Logo.hs
bsd-3-clause
721
0
5
145
118
82
36
14
0
module Util.Integral where instance Integral Float where quotRem a b = (fab, (ab - fab)*b) where ab = a/b fab = floor ab toInteger = floor instance Integral Double where quotRem a b = (fab, (ab - fab)*b) where ab = a/b fab = floor ab toInteger = floor
phylake/haskell-util
Integral.hs
bsd-3-clause
295
0
9
92
124
68
56
11
0
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, TemplateHaskell, DeriveGeneric #-} module OpenGL.Evaluator.GLPrimitives where import Data.Word import qualified Data.ByteString as BS import Data.Data import Data.Typeable import Foreign import Foreign.C.Types import Foreign.Storable import Data.Binary impor...
jfischoff/opengl-eval
src/OpenGL/Evaluator/GLPrimitives.hs
bsd-3-clause
3,172
0
8
642
1,053
568
485
73
0
{-# LANGUAGE NoImplicitPrelude, UnicodeSyntax #-} -- |Help.Imports provides a central location for universally shared exports, primarily -- the non-standard Prelude. module Help.Imports ( -- *Overrides FilePath -- *Re-Exports , module ClassyPrelude ...
argiopetech/help
Help/Imports.hs
bsd-3-clause
547
0
5
163
49
35
14
8
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Reactive.Banana.DOM.Widget ( ReactiveDom, CleanupHandler, IsWidget(..), IsEventWidget(..), WidgetInstance, mkWidget, re...
open-etcs/openetcs-dmi
src/Reactive/Banana/DOM/Widget.hs
bsd-3-clause
4,195
0
13
924
1,111
579
532
75
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANG...
mstksg/tensor-ops
src/Data/Type/Uniform.hs
bsd-3-clause
1,854
1
11
540
483
260
223
-1
-1
module Bump where import Control.Monad.Error (throwError, liftIO) import qualified Data.List as List import qualified Catalog import qualified CommandLine.Helpers as Cmd import qualified Diff.Compare as Compare import qualified Docs import qualified Elm.Docs as Docs import qualified Elm.Package.Description as Desc im...
rtfeldman/elm-package
src/Bump.hs
bsd-3-clause
8,561
0
17
2,741
1,709
897
812
172
4
-- HSlippyMap Exemple import HSlippyMap {-- let max = tileFromLatLong 48.9031 2.5214 10 let min = tileFromLatLong 48.8146 2.1732 10 mapM (\(x,y) -> mapM (\y'-> print $ "http://tile.openstreetmap.org/" ++ show z ++ "/" \ ++ show x ++ "/" ++ show y' ++ ".png") y) [(x,[(minimum [tymin, tymax])..(maximum [tymin\ ,tymax])]...
j4/HSlippyMap
hsl.hs
bsd-3-clause
914
0
19
205
230
124
106
12
1
{- - Hacq (c) 2013 NEC Laboratories America, Inc. All rights reserved. - - This file is part of Hacq. - Hacq is distributed under the 3-clause BSD license. - See the LICENSE file for more details. -} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE ...
ti1024/hacq
src/Control/Monad/Quantum/Base/Class.hs
bsd-3-clause
20,174
0
13
4,320
4,519
2,377
2,142
-1
-1
{-# LANGUAGE FlexibleContexts #-} -------------------------------------------------------------------------------- -- | -- Module : Network.OpenID.Discovery -- Copyright : (c) Trevor Elliott, 2008 -- License : BSD3 -- -- Maintainer : Trevor Elliott <trevor@geekgateway.com> -- Stability : -- Portability :...
substack/hsopenid
src/Network/OpenID/Discovery.hs
bsd-3-clause
5,704
0
26
1,576
1,550
802
748
111
5
{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Data.DList.Instances () where -- don't define instance for dlist>=0.8 && base>=4.9 #if !(MIN_VERSION_base(4,9,0)) || !(MIN_VERSION_dlist(0,8,0)) import Data.DList import Data.Semigroup instance Semigroup (DList a) where (<>) = append #endif
gregwebs/dlist-instances
Data/DList/Instances.hs
bsd-3-clause
311
0
7
41
46
30
16
7
0
{-# LANGUAGE NoImplicitPrelude, UnicodeSyntax, OverloadedStrings, TemplateHaskell #-} module Help.Settings ( -- *The Settings type Settings -- *Lens getters for Settings , ymlFile , logFile , logCollection ...
argiopetech/help
Help/Settings.hs
bsd-3-clause
8,648
0
15
3,386
1,673
877
796
159
10
{-# LANGUAGE OverloadedStrings #-} module Network.API.TLDR.Types.Time ( Time(..), LastActive(..), CreatedAt(..) ) where import Data.Aeson import Data.Aeson.Types (typeMismatch) import Data.Text (unpack) import ...
joshrotenberg/tldrio-hs
Network/API/TLDR/Types/Time.hs
bsd-3-clause
806
0
10
246
217
129
88
22
0
module FireHazard (grid, instructions, lightsLit) where import qualified Data.ByteString.Lazy.Char8 as C import Data.Vector as V (replicate,accum, Vector, foldr, sum) data Switch = ON | OFF | Toggle deriving (Eq, Show) type Grid = V.Vector (V.Vector Int) rv :: V.Vector Int rv = V.replicate 1000 0 grid :: Grid g...
cvsekhar/adventofcode
src/FireHazard.hs
bsd-3-clause
1,901
0
12
668
845
444
401
48
2
{-# LANGUAGE OverloadedStrings #-} module Text.Authoring.Combinator.Meta where import Control.Monad.Writer import Data.Text (Text) import Text.Authoring.Document import Text.Authoring.Combinator.Writer -- | wrap the argument @x@ using curly braces "{x}" braces :: (MonadWriter t m, HasDocument t) => m () -> m () b...
nushio3/authoring
src/Text/Authoring/Combinator/Meta.hs
bsd-3-clause
1,090
0
9
291
402
190
212
39
1
lend amount balance = let reserve = 100 newBalance = balance - amount in if balance < reserve then Nothing else Just newBalance lend2 amount balance = if amount < reserve * 0.5 then Just newBalan...
NeonGraal/rwh-stack
ch03/Lending.hs
bsd-3-clause
656
0
9
313
156
78
78
16
2
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. module Duckling.Quantity.EN.Tests ( tests ) where import Data.String import Prelude import Test.Tasty impor...
facebookincubator/duckling
tests/Duckling/Quantity/EN/Tests.hs
bsd-3-clause
557
0
9
87
93
57
36
12
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} module Main where import Arch import MainCommon import Data.String.Conv (toS) import Data.Aeson (encode) main :: IO () main = do doc <- getDocumentByArgs let packageStats = PackagesStats <$> f "core" <*> f "extra" ...
chrissound/ArchLinuxPkgStatsScraper
app/Main.hs
bsd-3-clause
628
0
15
188
179
88
91
22
2
module WeightForWeight where import Data.Char (digitToInt) import Data.List (sortBy) import Data.Ord (comparing) -- | Sort numbers by the sum of their digits (5 kyu) -- | Link: https://biturl.io/SortWeight -- | Refactored solution I came up with after completition of this kata -- originally I compared the number and...
Eugleo/Code-Wars
src/number-kata/WeightForWeight.hs
bsd-3-clause
646
0
9
114
103
59
44
7
1
import Graphics.Rendering.Chart.Easy import Graphics.Rendering.Chart.Backend.Cairo import Data.Time.LocalTime import Test.Examples.Prices(prices,mkDate,filterPrices) prices' :: [(LocalTime,Double,Double)] prices' = filterPrices prices (mkDate 1 1 2005) (mkDate 31 12 2006) main = toFile def "example2_big.png" $ do ...
visood/bioalgo
test/Test/Examples/Plots/priceHistory.hs
bsd-3-clause
1,859
0
15
413
218
122
96
-1
-1
{-# LANGUAGE RebindableSyntax #-} -- Copyright : (C) 2009 Corey O'Connor -- License : BSD-style (see the file LICENSE) import Bind.Marshal.Prelude import Bind.Marshal.Verify import Bind.Marshal.StdLib.Dynamic.ByteString.Lazy.Des main = run_test $ do returnM () :: Test ()
coreyoconnor/bind-marshal
test/verify_stdlib_dynamic_bytestring_lazy_des.hs
bsd-3-clause
288
0
9
51
51
31
20
6
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} module Server where import Control.Mona...
odr/pers
app/Server.hs
bsd-3-clause
2,863
0
12
544
670
386
284
-1
-1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE RecordWildCards #-} module IOCP.Worker ( Worker, new, enqueue, -- * Helpers forkOSUnmasked, ) where import Control.Concurrent import Control.Exception (mask_) import Control.Monad (forever, void) import Data.IORef import GHC.IO (un...
joeyadams/haskell-iocp
IOCP/Worker.hs
bsd-3-clause
1,794
0
14
418
450
236
214
42
1
module Graphomania.Builder.FromVertices ( ) where -- TODO: -- - Граф Fold по вершинам. -- - Вершина. Внешний ID; Тэг (не испльзуется); Fold по рёбрам. -- - Ребро. ID вершины, на которую оно указывает + Тэг. -- ID вершины является внутренним идентификатором, но для вершины исходного графа. -- 1. не использовать зд...
schernichkin/BSPM
graphomania/src/Graphomania/Builder/FromVertices.hs
bsd-3-clause
829
0
3
97
19
16
3
2
0
-- | Some auxiliary crypto types module UTxO.Crypto ( -- * Key-pairs RegularKeyPair(..) , EncKeyPair(..) , RedeemKeyPair(..) , regularKeyPair , encKeyPair , encToRegular -- * Abstract API , SomeKeyPair(..) , TxOwnedInput , ClassifiedInputs(..) , classifyInputs -- * Delegation , Deleg...
input-output-hk/cardano-sl
utxo/src/UTxO/Crypto.hs
apache-2.0
5,350
0
14
1,285
1,108
606
502
-1
-1
import Application (appMain) import Prelude (IO) main :: IO () main = appMain
sulami/hGM
app/main.hs
bsd-3-clause
103
0
6
38
32
18
14
4
1
-- (c) The University of Glasgow 2006 -- -- FamInstEnv: Type checked family instance declarations {-# LANGUAGE CPP, GADTs, ScopedTypeVariables #-} module FamInstEnv ( FamInst(..), FamFlavor(..), famInstAxiom, famInstTyCon, famInstRHS, famInstsRepTyCons, famInstRepTyCon_maybe, dataFamInstRepTyCon, ...
oldmanmike/ghc
compiler/types/FamInstEnv.hs
bsd-3-clause
64,841
6
21
18,404
9,348
5,029
4,319
-1
-1
{-# LANGUAGE ExistentialQuantification #-} -- |This module provides widgets to center other widgets horizontally -- and vertically. These centering widgets relay focus and key events -- to their children. module Graphics.Vty.Widgets.Centering ( HCentered , VCentered , hCentered , vCentered , center...
KommuSoft/vty-ui
src/Graphics/Vty/Widgets/Centering.hs
bsd-3-clause
4,135
0
21
1,545
1,095
561
534
84
2
{-# LANGUAGE MagicHash #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE UnboxedTuples #-} {-# OPTIONS_HADDOCK hide #-} -- | -- Module : Data.Array.Accelerate.Lifetime -- Copyright : [2015] Robert Clifton-Everest, Manuel M T Chakravarty, Gabriele Keller -- License : BSD3 -- -- Maintainer : Robert Clifton-...
rrnewton/accelerate
Data/Array/Accelerate/Lifetime.hs
bsd-3-clause
4,837
0
14
1,018
831
469
362
44
1
---------------------------------------------------------------------------- -- | -- Module : Main -- Copyright : (c) Spencer Janssen 2007 -- License : BSD3-style (see LICENSE) -- -- Maintainer : sjanssen@cse.unl.edu -- Stability : unstable -- Portability : not portable, uses mtl, X11, posix -- -- x...
atupal/xmonad-mirror
xmonad/Main.hs
mit
3,413
0
16
932
608
323
285
58
9
module Network.Haskoin.Wallet.Tests (tests) where import Test.Framework (Test, testGroup) import Test.Framework.Providers.QuickCheck2 (testProperty) import Data.Aeson (FromJSON, ToJSON, encode, decode) import Network.Haskoin.Wallet.Arbitrary () import Network.Haskoin.Wallet tests :: [Test] tests = [ testGroup "...
tphyahoo/haskoin-wallet
tests/Network/Haskoin/Wallet/Tests.hs
unlicense
674
0
10
129
209
122
87
14
1
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} import Control.CP.FD.Example -- diffList: the differences between successive elements of a list diffList l = exists $ \d -> do -- request a (collection) variable d let n = size l -- introduce n as alias for size l size d @= n-1 ...
neothemachine/monadiccp
examples/AllInterval.hs
bsd-3-clause
1,386
0
18
523
291
152
139
22
1
{-# LANGUAGE RankNTypes #-} module Toplevel where import Data.Char(isAlpha,isDigit) import Data.List(partition,(\\),nub,find,deleteBy,sort) import Data.Map(Map,toList) import System.IO import Version(version,buildtime) import Syntax import ParserDef(getInt,pCommand,parseString,Command(..) ,program,par...
cartazio/omega
src/Toplevel.hs
bsd-3-clause
14,847
0
21
3,697
4,552
2,413
2,139
238
7
module Get.Init where import System.IO (hFlush, stdout) import Data.Aeson.Encode.Pretty (encodePretty) import qualified Elm.Package.Name as N import qualified Elm.Package.Version as V import qualified Elm.Package.Description as D import qualified Elm.Package.Paths as Path import qualified Data.ByteString.Lazy as BS ...
laszlopandy/elm-package
src/Get/Init.hs
bsd-3-clause
2,361
0
12
538
718
358
360
55
2
module ShouldCompile where (<>) :: (a -> Maybe b) -> (b -> Maybe c) -> (a -> Maybe c) (m1 <> m2) a1 = case m1 a1 of Nothing -> Nothing Just a2 -> m2 a2
ezyang/ghc
testsuite/tests/parser/should_compile/read026.hs
bsd-3-clause
209
0
11
93
91
46
45
5
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module TH_RichKinds2 where import Data.Char import Data.List import Language.Haskell.TH $(return [OpenTypeFamilyD ...
ezyang/ghc
testsuite/tests/th/TH_RichKinds2.hs
bsd-3-clause
1,698
0
21
620
444
231
213
41
1
{-# LANGUAGE TypeFamilies #-} module B where class Entity v where data Fields v instance Show (Fields v) where show = undefined
wxwxwwxxx/ghc
testsuite/tests/driver/T5147/B1.hs
bsd-3-clause
134
0
7
28
37
21
16
5
0
module ShouldFail where data Foo = MkFoo Bool instance Eq Foo where (MkFoo x) == (MkFoo y) = x == y instance Eq Foo where -- forgot to type "Ord" above (MkFoo x) <= (MkFoo y) = x <= y
urbanslug/ghc
testsuite/tests/typecheck/should_fail/tcfail056.hs
bsd-3-clause
200
0
8
56
84
43
41
6
0
{-# LANGUAGE OverloadedStrings #-} -- | The @futhark@ command line program. module Main (main) where import Control.Exception import Control.Monad import Data.List (sortOn) import Data.Maybe import qualified Data.Text as T import qualified Data.Text.IO as T import qualified Futhark.CLI.Autotune as Autotune import qua...
diku-dk/futhark
src/main.hs
isc
5,513
0
16
1,082
1,438
848
590
124
2
{-# LANGUAGE OverloadedStrings #-} module Store.SQL.Util.Pivots where {-- Pivot tables --------------------------------------------------------------- Last week you were able to scan the database, extract rows of name(s), parse the names, then store them as parsed entities in the database connected to the source art...
geophf/1HaskellADay
exercises/HAD/Store/SQL/Util/Pivots.hs
mit
3,684
0
19
794
775
424
351
-1
-1
{-| Module : Types Description : Example of types operations in Haskell Copyright : (c) Fabrício Olivetti, 2017 License : GPL-3 Maintainer : fabricio.olivetti@gmail.com A sample of operations with different types. -} module Main where -- |'soma' sums two integer values soma :: Integer -> Integer -> Integ...
folivetti/BIGDATA
02 - Básico/Types.hs
mit
685
0
10
151
160
87
73
10
1
{-# LANGUAGE OverloadedStrings #-} module Compiler.Types where import Constants import Control.Monad (mzero) import CoreTypes import Data.Aeson (FromJSON (..), ToJSON (..), Value (..), object, (.:), (.=)) import Language.Types impo...
badi/super-user-spark
src/Compiler/Types.hs
mit
1,955
0
11
577
482
273
209
50
0
-- Traits type class -- ref: https://wiki.haskell.org/Traits_type_class -- ref: https://wiki.haskell.org/Reified_type -- blog: http://augustss.blogspot.nl/2007/04/overloading-haskell-numbers-part-3.html -- Occasionally you want to associate information with a type, not just a value. An example is the standard Bounded ...
Airtnp/Freshman_Simple_Haskell_Lib
Idioms/Traits-type-class.hs
mit
3,073
2
7
601
277
152
125
-1
-1
module Debug.Debug ( DebugShow, debug_show, ) where class DebugShow a where debug_show :: a -> String
quintenpalmer/fresh
haskell/src/Debug/Debug.hs
mit
115
0
7
29
33
19
14
5
0
-- Convert string to camel case -- http://www.codewars.com/kata/517abf86da9663f1d2000003/ module CamelCase where import Data.Char (toUpper) import Data.List.Split (split, dropDelims, oneOf) toCamelCase :: String -> String toCamelCase str = f . split (dropDelims $ oneOf "-_") $ str where f [] = [] f [x]...
gafiatulin/codewars
src/5 kyu/CamelCase.hs
mit
422
0
10
111
154
83
71
10
4
{-# LANGUAGE CPP #-} {-# LANGUAGE ViewPatterns #-} module Hpack.Render.Hints ( FormattingHints (..) , sniffFormattingHints #ifdef TEST , extractFieldOrder , extractSectionsFieldOrder , sanitize , unindent , sniffAlignment , splitField , sniffIndentation , sniffCommaStyle #endif ) where import Data.Char imp...
haskell-tinc/hpack
src/Hpack/Render/Hints.hs
mit
3,834
63
18
740
1,134
614
520
77
4
{-# LANGUAGE FlexibleContexts #-} {- Copyright (C) 2012 Kacper Bak <http://gsd.uwaterloo.ca> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation t...
juodaspaulius/clafer-old-customBNFC
src/Language/Clafer/Intermediate/ResolverInheritance.hs
mit
10,166
1
18
2,168
2,994
1,522
1,472
180
4
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Cilia.Config where import Prelude import Data.Maybe(fromMaybe) import qualified Data.Text as T import Data.Yaml( FromJSON(..) , (.:) , (.:?) , decodeFileEither) import qualified Data.Yaml as Y i...
bbiskup/cilia
src-lib/Cilia/Config.hs
mit
1,446
0
9
364
385
209
176
42
1
module Y2017.M01.D02.Exercise where import Data.List import Data.Set (Set) {-- Happy New Year, Haskellers. Dr. Paul Coxon claims 2017 will be less divisive than 2016. He is correct, but let's prove it. 1. What are the unique divisors of last year and this year? --} type Year = Int uniqueFactors :: Year -> Set In...
geophf/1HaskellADay
exercises/HAD/Y2017/M01/D02/Exercise.hs
mit
1,147
0
9
218
144
83
61
12
1
{-# LANGUAGE OverloadedStrings #-} module Utils.Password ( Password (Password) , PasswordHash , verifyPassword , createPasswordHash , writePasswordHashToFile , readPasswordHashFromFile )where import Data.String (IsString(..)) import Data.Text (Text) import Data.Text.Encoding (encodeUtf8) import Data.B...
CarstenKoenig/MyWebSite
src/Utils/Password.hs
mit
1,215
0
10
200
294
170
124
40
1
-- Smallest multiple -- Problem 5 -- 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? main = do print (getSmallestN) getSmallestN = head [x | x <- [25...
BrunoRB/haskell-problems
euler/euler5.hs
mit
404
0
10
90
84
46
38
6
1
module GHCJS.DOM.MediaKeyEvent ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/MediaKeyEvent.hs
mit
43
0
3
7
10
7
3
1
0
module Main where import Servant.Server import Network.Wai.Handler.Warp import Api -------------------------------------------------------------------------------- main :: IO () main = do run 3000 (serve api server)
sigrlami/servant-examples
servant-auth-basic/src/Main.hs
mit
222
0
9
28
51
29
22
7
1
module Parser.Expression where import Text.Parsec import Text.Parsec.String import Text.Parsec.Char import Types import Parser.Common -- CALL -- call :: Parser Call call = do pos <- getPosition name <- identifier openParen args <- expr `sepBy` (char ',') closeParen return $ Call pos name args -- EXPRES...
PelleJuul/popl
src/Parser/Expression.hs
mit
1,279
0
15
301
498
240
258
55
1