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
import Data.Ratio import Data.List (sort, nub, maximumBy) import Data.Function (on) import Common.Utils (if') ratio2Integer :: (Ratio Integer) -> Integer ratio2Integer r = if' (a `mod` b == 0) (a `div` b) (-1) where a = numerator r b = denominator r solve :: [Integer] -> Integer solve xs = getConsecutive $ co...
foreverbell/project-euler-solutions
src/93.hs
bsd-3-clause
1,736
0
18
589
907
475
432
43
10
{-# LANGUAGE RankNTypes #-} ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2015 Dimitri Sabadie -- License : BSD3 -- -- Maintainer : Dimitri Sabadie <dimitri.sabadie@gmail.com> -- Stability : experimental -- Portability : portable -- ---------------------...
phaazon/quaazar
src/Quaazar/System/Resource.hs
bsd-3-clause
2,122
0
16
463
604
329
275
-1
-1
module Lib (someFunc ) where import Ranked.Type import Ranked.Infer import State (Infer) uni :: Infer T uni = do a <- newVar 0 b <- newVar 0 c <- newVar 0 unify (TArrow [TConst "int", TConst "bool"] $ TConst "int") (TArrow [a, b] c) return $ TArrow [a, b] c someFunc :: IO () someFunc = do...
zjhmale/HMF
src/Lib.hs
bsd-3-clause
346
0
12
101
163
81
82
16
1
{-# LANGUAGE ViewPatterns #-} -- | Description: Run /Retcon/ as a one-shot command. -- module Retcon.Program.Once ( -- * One-shot `retcon` on documents Request(..) , retconOnce -- * Run store commands , runPSQL ) where import Control.Exception import Control.Monad.IO.Class import ...
anchor/retcon
lib/Retcon/Program/Once.hs
bsd-3-clause
2,144
0
13
596
536
279
257
53
5
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE OverloadedStrings #-} module Reporting.Error ( Error(..) , toString , toStderr ) where import qualified Text.PrettyPrint.ANSI.Leijen as P import qualified Elm.Compiler as Compiler import qualified Elm.Compiler.Module as Module import qualified Elm.Package as Pkg impor...
evancz/builder
src/Reporting/Error.hs
bsd-3-clause
5,003
0
18
1,339
956
540
416
102
13
-- | -- Module : $Header$ -- Copyright : (c) 2013-2015 Galois, Inc. -- License : BSD3 -- Maintainer : cryptol@galois.com -- Stability : provisional -- Portability : portable {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} module Notebook where import Cryptol.REPL.Monad (REPL...
ZenDevelopmentSystems/ICryptol
src/Notebook.hs
bsd-3-clause
6,501
0
21
1,494
1,693
922
771
114
2
{-# LINE 1 "Data.Ratio.hs" #-} {-# LANGUAGE Safe #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Ratio -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@has...
phischu/fragnix
builtins/base/Data.Ratio.hs
bsd-3-clause
3,051
0
11
1,226
422
232
190
31
1
-- for @ {-# LANGUAGE TypeApplications #-} -- for forall r c capturing with Proxy {-# LANGUAGE ScopedTypeVariables #-} -- lift 2, 3, etc to type level {-# LANGUAGE DataKinds #-} -- for *, + in type sigs {-# LANGUAGE TypeOperators #-} -- for *, + in type sigs {-# LANGUAGE FlexibleContexts #-} -- for (*) which is ...
bollu/symengine.hs-1
test/Spec.hs
mit
6,846
0
16
1,713
2,087
1,069
1,018
-1
-1
{-# LANGUAGE TypeOperators #-} module Main where import Data.Array.Repa import DeepLearning.ConvNet import DeepLearning.Util -- |Main main :: IO () main = do (pvol, acts) <- withActivations (testNet testShape 2) (testInput testShape) print (computeS pvol :: Vol DIM1) print acts
silky/deeplearning-hs
Main.hs
mit
317
0
10
77
93
49
44
10
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE ExplicitForAll #-} -- | This module provides wrappers in 'IO' around the functions from -- "Data.HashTable.Class". -- -- This module exports three concrete hash table types, one for each hash table -- implement...
cornell-pl/HsAdapton
weak-hashtables/src/Data/HashTable/Weak/IO.hs
bsd-3-clause
12,707
0
12
2,485
1,754
996
758
142
1
import DPH.Testsuite import DPH.Arbitrary.Segd import Data.Array.Parallel.Unlifted as U import Prelude as P $(testcases [ "" <@ [t| ( Bool, Int ) |] , "acc" <@ [t| ( Int ) |] , "num" <@ [t| ( Int ) |] , "ord" <@ [t| ( Bool, Int ) |] , "enum...
mainland/dph
dph-test/test/Unlifted/Segd.hs
bsd-3-clause
1,488
0
9
504
97
67
30
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} module Ros.Std_msgs.ByteMultiArray where import qualified Prelude as P import Prelude ((.), (+), (*)) import qualified Data.Typeable as T import Control.Applicative import Ros.Internal....
acowley/roshask
msgs/Std_msgs/Ros/Std_msgs/ByteMultiArray.hs
bsd-3-clause
1,234
1
10
218
289
175
114
29
0
{-# LANGUAGE FlexibleContexts , FlexibleInstances , MultiParamTypeClasses , RankNTypes , ScopedTypeVariables , TypeOperators , UndecidableInstances #-} {- | Module : StackTransCFJava Description : Translation of FCore to Java with Stack-opt Copyri...
bixuanzju/fcore
lib/StackTransCFJava.hs
bsd-2-clause
15,623
1
29
6,285
3,242
1,680
1,562
182
13
{-# LANGUAGE RecordWildCards, TupleSections, ViewPatterns, RankNTypes, TypeOperators, TypeFamilies, ExistentialQuantification #-} {-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleInstances, FlexibleContexts, ScopedTypeVariables #-} module General.Database( Pred, (%==), (%==%), (%>), (%<), (%/=), (%&&), nullP, like...
Pitometsu/bake
src/General/Database.hs
bsd-3-clause
11,552
0
23
2,783
5,015
2,624
2,391
193
17
{-#LANGUAGE ParallelListComp, RecordWildCards, DeriveGeneric#-} module Main where import CV.Image import CV.Tracking import CV.Bindings.Types import CV.Drawing import CV.ImageOp import Utils.Rectangle import Text.Printf import CV.ImageMathOp hiding ((#>)) import CV.Filters import CV.ColourUtils import Utils.Rectangle ...
BeautifulDestinations/CV
examples/TreeTop.hs
bsd-3-clause
2,158
0
15
664
891
489
402
47
1
-- A simple program to demonstrate Gtk2Hs. module Main (Main.main) where import Graphics.UI.Gtk main :: IO () main = do initGUI -- Create a new window window <- windowNew -- Here we connect the "destroy" event to a signal handler. -- This event occurs when we call widgetDestroy on the window -- or if the ...
k0001/gtk2hs
gtk/demo/hello/World.hs
gpl-3.0
1,669
0
10
340
179
93
86
17
1
module Eval where import qualified Data.Set as S {-@ measure keys @-} keys :: (Ord k) => [(k, v)] -> S.Set k keys [] = S.empty keys (kv:kvs) = (S.singleton (myfst kv)) `S.union` (keys kvs) {-@ measure myfst @-} myfst :: (a, b) -> a myfst (x, _) = x -- this is fine {-@ measure okeys :: [(a, b)] -> (S.Set a) ...
abakst/liquidhaskell
tests/pos/Keys.hs
bsd-3-clause
423
0
9
104
132
77
55
7
1
main = case 1 > 10 of True -> do putStrLn "hello" putStrLn "there" False -> do putStrLn "blah" putStrLn "blah"
mpickering/ghc-exactprint
tests/examples/ghc710/FooExpected.hs
bsd-3-clause
151
0
10
61
50
21
29
6
2
import System.FilePath.Glob import Test.DocTest main :: IO () main = glob "src/**/*.hs" >>= doctest
angerman/data-bitcode-edsl
test/Doctest.hs
bsd-3-clause
101
0
6
15
34
18
16
4
1
module T9681 where foo = 1 + "\n"
ghc-android/ghc
libraries/base/tests/T9681.hs
bsd-3-clause
35
0
5
9
13
8
5
2
1
-- From the blog post Fun With XPolyKinds : Polykinded Folds -- http://www.typesandotherdistractions.com/2012/02/fun-with-xpolykinds-polykinded-folds.html {- In the following, I will write a polykinded version of the combinators fold and unfold, along with three examples: folds for regular datatypes (specialized to ...
ghc-android/ghc
testsuite/tests/polykinds/Freeman.hs
bsd-3-clause
9,490
1
15
2,120
2,407
1,256
1,151
109
2
{-| Module : BreadU.Pages.CSS.Names Description : Names for our own CSS-classes. Stability : experimental Portability : POSIX Names for our own CSS-classes. We don't want to work with raw string literals explicitly, so we just define a type with nullary constructors corresponding to names of classes. These cons...
denisshevchenko/breadu.info
src/lib/BreadU/Pages/CSS/Names.hs
mit
2,052
0
7
494
220
141
79
48
0
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE TemplateHaskell #-} module PrefixCompression(runTests) where import Test.QuickCheck import Text.Printf main :: IO () main = interact run run :: String -> String run input = output where output = unlines . map print' $ [p, a', b'] print' :: Stri...
alexander-matsievsky/HackerRank
All_Domains/Functional_Programming/Recursion/src/PrefixCompression.hs
mit
778
0
11
191
244
126
118
24
1
{-# LANGUAGE JavaScriptFFI #-} -- | FIXME: doc module GHCJS.Electron.PowerMonitor where
taktoa/ghcjs-electron
src/GHCJS/Electron/PowerMonitor.hs
mit
89
0
3
12
9
7
2
2
0
{-# LANGUAGE LambdaCase #-} module TC.Util where import Control.Monad.Gen import Control.Monad.Except import Data.Foldable (foldMap) import qualified Data.Set as S import Source data TypeError = NoSuchName Name | TySynCycle Name | OccursFail Name | CannotMerge ...
jozefg/hi
src/TC/Util.hs
mit
1,316
0
11
370
547
272
275
47
12
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} module Routes where -- Libs import Servant import Servant.Generic -- Source import Models -- Abstraction over Content Types data Routes path = Routes { api :: path :- ApiRouter } deriving Generic type Router = ToS...
erlandsona/caldwell-api
library/Routes.hs
mit
600
0
14
125
155
92
63
17
0
{-# LANGUAGE OverloadedStrings, Rank2Types #-} module Web.Authenticate.SQRL where import Web.Authenticate.SQRL.Types --import Data.Char (isDigit, isAlpha) import Crypto.Random import Crypto.Cipher.AES import qualified Crypto.Ed25519.Exceptions as ED25519 import Control.Applicative import Control.Concurrent.MVar impor...
TimLuq/sqrl-auth-hs
src/Web/Authenticate/SQRL.hs
mit
12,772
15
33
3,322
3,136
1,691
1,445
171
13
module LiftIO.Prelude where import Control.Monad.IO.Class (MonadIO,liftIO) putCharM :: MonadIO m => Char -> m () putCharM = liftIO . putChar putStrM :: MonadIO m => String -> m () putStrM = liftIO . putStr putStrLnM :: MonadIO m => String -> m () putStrLnM = liftIO . putStrLn printM :: (Show a, MonadIO m) => a -> ...
trbecker/liftio
src/LiftIO/Prelude.hs
mit
1,100
0
9
221
458
232
226
30
1
module Settings.Builders.Tar (tarBuilderArgs) where import Settings.Builders.Common tarBuilderArgs :: Args tarBuilderArgs = builder Tar ? mconcat [ arg "-xf" , input "*.gz" ? arg "--gzip" , input "*.bz2" ? arg "--bzip2" ...
izgzhen/hadrian
src/Settings/Builders/Tar.hs
mit
430
0
9
200
90
48
42
8
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Shell ( State , mkState , nodeGetHttpConfig , nodeSetHttpConfig , nodeLoadProgram , nodeListSelectedProgram , nodeListPrograms , nodeListPatterns , nodeRunNamedPattern , nodeRunRandomPattern , nodeLi...
kosmoskatten/ghost-lang
ghost-shell/src/Shell.hs
mit
6,199
0
15
1,924
1,664
848
816
129
1
{-# LANGUAGE RecordWildCards #-} -- | Library for spawning and working with Ghci sessions. module Language.Haskell.Ghcid( Ghci, GhciError(..), Stream(..), Load(..), Severity(..), startGhci, stopGhci, interrupt, process, execStream, showModules, reload, exec, quit ) where import System.IO import Sy...
wereHamster/nauva
pkg/hs/nauvad/src/Language/Haskell/Ghcid.hs
mit
9,447
0
26
2,651
2,082
1,037
1,045
151
9
module Phi.Window ( Window, mkWindow , length , push , phi ) where import Data.Vector.Unboxed (Vector) import qualified Data.Vector.Unboxed as V import Prelude hiding (length) import Statistics.Distribution (complCumulative) im...
reinh/hs-phi
src/Phi/Window.hs
mit
919
0
11
278
271
152
119
31
1
{-# LANGUAGE OverloadedStrings #-} module Y2020.M11.D09.Solution where {-- The previous exercise had you parse the European Union's member states then add that to the AllianceMap of the world. That was easy, because those data were available as wikidata.org JSON. Not so for the United Nations (which we will do toda...
geophf/1HaskellADay
exercises/HAD/Y2020/M11/D09/Solution.hs
mit
3,005
0
10
567
348
206
142
30
1
module GHCJS.DOM.CustomEvent ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/CustomEvent.hs
mit
41
0
3
7
10
7
3
1
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-s3action.html module Stratosphere.ResourceProperties.SESReceiptRuleS3Action where import Str...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/SESReceiptRuleS3Action.hs
mit
2,981
0
13
308
447
253
194
38
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedLists #-} module BoxProperties ( testBox ) where import Crypto.Saltine.Core.Box import Data.Monoid import Test.Framework.Providers.QuickCheck2 import Test.Framework import Test.QuickCheck.Property import Test.QuickCheck.Monadic import Util -- | Ciphertext...
tel/saltine
tests/BoxProperties.hs
mit
3,846
0
14
748
1,016
516
500
69
1
-- Copyright 2015 Mitchell Kember. Subject to the MIT License. -- Project Euler: Problem 21 -- Amicable numbers module Problem21 where import Common (properDivisors) import Data.Tuple (swap) amicablePairs :: Int -> [(Int, Int)] amicablePairs limit = filter amicable pairs where pairs = map withSum [1..limit] ...
mk12/euler
haskell/Problem21.hs
mit
500
0
10
100
161
90
71
10
1
-- Informatics 1 - Functional Programming -- Tutorial 7 -- -- Week 9 - Due: 19/20 Nov. import LSystem import Test.QuickCheck -- Exercise 1 -- 1a. split split :: Command -> [Command] split = undefined -- 1b. join join :: [Command] -> Command join = undefined -- 1c equivalent equivalent = undefined -- 1d. testin...
PavelClaudiuStefan/FMI
An_3_Semestru_1/ProgramareDeclarativa/Extra/Laborator/Laborator 7/lab7.hs
cc0-1.0
1,091
2
11
218
334
164
170
27
1
{-# LANGUAGE ExistentialQuantification #-} -- | -- Module : Main -- Copyright : (c) Joachim Fasting 2010 -- License : GPL-2 (see COPYING) -- -- Maintainer : joachim.fasting@gmail.com -- Stability : unstable -- Portability : not portable -- -- A FUSE filesystem for the Music Player Daemon (MPD). -- See RE...
joachifm/mpdfs
Main.hs
gpl-2.0
14,818
0
19
4,751
4,685
2,467
2,218
286
16
{-# LANGUAGE PatternGuards #-} module Latex ( latexEasy, latexOptimizedExpression ) where import Expression ( Expression(..), Exprn(..), Type, substitute, latex, k, k_var, IsTemp( CannotBeFreed ), cleanvars, mapExprn, mkExprn ) import Statement ( Statement(..), freeVectors, reus...
droundy/deft
src/haskell/Latex.hs
gpl-2.0
4,641
0
15
1,537
1,492
769
723
86
4
module Zepto.Primitives.RegexPrimitives where import Control.Monad.Except (throwError) import Data.ByteString.Char8 (unpack, pack) import Text.Regex.PCRE.Heavy import qualified Text.Regex.PCRE.Light.Base as R import Zepto.Types makeRegexDoc :: String makeRegexDoc = "creates a new regex from a string <par>s</par>.\n\...
zepto-lang/zepto
src/Zepto/Primitives/RegexPrimitives.hs
gpl-2.0
5,734
158
14
1,121
2,271
1,163
1,108
-1
-1
{-# LANGUAGE RankNTypes, OverloadedStrings #-} module Game.Boggle.Bot ( boggleBot ,sanitize ) where import Control.Applicative import Control.Lens import Control.Monad import Control.Monad.Except import Control.Monad.State import qualified Data.Byt...
revnull/bogglebot
src/Game/Boggle/Bot.hs
gpl-3.0
6,897
0
34
3,106
2,162
1,070
1,092
145
16
{- | Module : Constant Description : Constant values for the SonyGPSAssist program. Copyright : (c) Frédéric BISSON, 2015 License : GPL-3 Maintainer : zigazou@free.fr Stability : experimental Portability : POSIX -} module Constant where import Network.Curl (URLString) {- | The URL pointing the Sony GPS ...
Zigazou/SonyGPSAssistHS
src/Constant.hs
gpl-3.0
907
0
5
144
70
45
25
12
1
module Cashflow.Parser ( P.ParseError ,D.Entries ,parseFile ,parse ) where import qualified Text.Parsec as P import qualified Text.Parsec.String as PS import Control.Applicative import Data.Monoid import qualified Cashflow.Entry as D ws :: PS.Parser String ws = many (P.oneOf " \t,") newLine :: PS.P...
StarvingMarvin/cashflow
src/Cashflow/Parser.hs
gpl-3.0
3,668
0
11
730
1,374
702
672
89
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE UnicodeSyntax #-} {-# OPTIONS_HADDOCK show-extensions #-} -- | -- Module ...
Fuuzetsu/yi-agda
src/Yi/Mode/Agda.hs
gpl-3.0
22,611
0
36
6,155
6,704
3,447
3,257
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-containerbuilder/gen/Network/Google/Resource/Cloudbuild/Projects/Locations/Triggers/List.hs
mpl-2.0
6,354
0
19
1,465
960
554
406
139
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/Admin/Channels/Stop.hs
mpl-2.0
4,648
0
18
1,134
727
424
303
106
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.AcceleratedMobilePageURL.Types -- Copyright : (c) 2015...
brendanhay/gogol
gogol-acceleratedmobilepageurl/gen/Network/Google/AcceleratedMobilePageURL/Types.hs
mpl-2.0
1,875
0
7
370
154
110
44
38
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-vault/gen/Network/Google/Resource/Vault/Operations/Get.hs
mpl-2.0
4,505
0
15
1,057
701
411
290
99
1
{-# OPTIONS_GHC -F -pgmF dist/build/htfpp/htfpp #-} module MaxPrevTime (maxPrevTimeMain) where import Test.Framework import Control.Concurrent test_slow :: IO () test_slow = threadDelay 20000 test_fast :: IO () test_fast = return () maxPrevTimeMain args = htfMainWithArgs args htf_thisModulesTests
ekarayel/HTF
tests/real-bbt/MaxPrevTime.hs
lgpl-2.1
302
0
6
40
71
38
33
9
1
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE PatternSynonyms #-} module Dyno.DirectCollocation.Quadratures ( QuadratureRoots...
ghorn/dynobud
dynobud/src/Dyno/DirectCollocation/Quadratures.hs
lgpl-3.0
3,097
0
15
683
1,106
601
505
73
3
data Point = Point Float Float deriving (Show) data Shape = Circle Point Float | Rectangle Point Point deriving (Show) surface:: Shape -> Float surface(Circle _ r) = pi * r ^ 2 surface(Rectangle (Point x1 y1) (Point x2 y2)) = (abs $ y2 - y1) * (abs $ x2 - x1) -- a function that moves the shape from initial coordina...
iUwej/learnyehaskell
dataclasses.hs
unlicense
796
3
13
153
395
195
200
12
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} -------------------...
PipocaQuemada/ermine
src/Ermine/Unification/Sharing.hs
bsd-2-clause
4,254
0
16
855
1,161
605
556
102
2
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE BangPatterns #-} module Juno.Messaging.ZMQ ( runMsgServer ) where import Control.Concurrent (forkIO, threadDelay, yield, newMVar, takeMVar, putMVar, yield, new...
buckie/juno
src/Juno/Messaging/ZMQ.hs
bsd-3-clause
5,599
0
28
1,323
1,883
922
961
118
4
{-# LANGUAGE BangPatterns, OverloadedStrings #-} module Network.HPACK.HeaderBlock.Integer ( encode , decode , parseInteger ) where import Data.Array (Array, listArray, (!)) import Data.Bits ((.&.), shiftR) import Data.ByteString (ByteString) import qualified Data.ByteString as BS import Data.Word (Word8) -...
bergmark/http2
Network/HPACK/HeaderBlock/Integer.hs
bsd-3-clause
2,725
0
11
746
701
381
320
46
1
-- Copyright 2013 Kevin Backhouse. module TestDelay ( instanceTest ) where import Control.Monad.ST2 import Control.Monad.MultiPass import Control.Monad.MultiPass.Instrument.Delay import Control.Monad.MultiPass.Utils.InstanceTest -- This test checks that all the necessary instances have been -- defined. Its only purp...
kevinbackhouse/Control-Monad-MultiPass
tests/TestDelay.hs
bsd-3-clause
554
0
6
76
80
50
30
9
1
{-# OPTIONS_GHC -Wall #-} module SourceSyntax.Helpers where import qualified Data.Char as Char splitDots :: String -> [String] splitDots = go [] where go vars str = case break (=='.') str of (x,_:rest) | isOp x -> vars ++ [x ++ '.' : rest] | otherwise -> go (vars ++ [x]) r...
deadfoxygrandpa/Elm
compiler/SourceSyntax/Helpers.hs
bsd-3-clause
648
0
14
182
265
139
126
20
2
{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANG...
AaronFriel/eff-experiments
src/Data/Iota/Unified/Indexed5.hs
bsd-3-clause
16,377
2
22
4,411
3,149
1,751
1,398
-1
-1
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. ------------------...
facebookincubator/duckling
Duckling/Ranking/Classifiers/KO_XX.hs
bsd-3-clause
92,149
0
15
45,318
16,136
10,059
6,077
1,493
1
module Network.HaskellNet.IMAP ( connectIMAP, connectIMAPPort, connectStream -- * IMAP commands -- ** any state commands , noop, capability, logout -- ** not authenticated state commands , login, authenticate -- ** autenticated state commands , select, examine, create, delete, re...
danchoi/HaskellNet
src/Network/HaskellNet/IMAP.hs
bsd-3-clause
18,363
0
18
5,836
6,190
3,086
3,104
362
12
---------------------------------------------------------------------- module Sudoku.Cover ( pureCoverSolver, fastPureCoverSolver, dlxSolver, boardConstraints, givenConstraints ) where import Data.List (sort) import Data.Maybe (catMaybes) import Cover (makeColumn, Column, fastPureSolve, pureSolve, dl...
d3zd3z/sudoku
Sudoku/Cover.hs
bsd-3-clause
3,083
0
17
718
1,084
576
508
55
1
-- Advent of Code ---- Day 5: Doesn't he have intern-elves for this? module AOC2015.Day05 where import Data.List adjacents :: String -> [(Char,Char)] adjacents str = zip str $ tail str extractEqPairs :: Eq a => [(a,a)] -> [(a,a)] extractEqPairs adj = [(x,y) | (x,y) <- adj, x == y] nice :: String -> Bool nice str =...
bitrauser/aoc
src/AOC2015/Day05.hs
bsd-3-clause
1,793
0
12
410
691
359
332
44
1
{-# LANGUAGE DeriveGeneric, DeriveDataTypeable, GeneralizedNewtypeDeriving #-} -- | Handling project configuration, types. -- module Distribution.Client.ProjectConfig.Types ( -- * Types for project config ProjectConfig(..), ProjectConfigBuildOnly(..), ProjectConfigShared(..), ProjectConfigProvenan...
themoritz/cabal
cabal-install/Distribution/Client/ProjectConfig/Types.hs
bsd-3-clause
17,779
0
14
4,507
2,267
1,381
886
241
0
import System.Environment(getArgs,getProgName) import System.Console.GetOpt(getOpt,ArgOrder(..),OptDescr(..),ArgDescr(..),usageInfo) import System.FilePath.Posix((</>),(<.>),isAbsolute,takeFileName,dropTrailingPathSeparator) import Data.Time(getCurrentTime,diffUTCTime,addUTCTime) import Data.List(intercalate) import Fr...
jkarlson/fdo-trash
fdo-trash.hs
bsd-3-clause
9,500
46
22
2,370
3,181
1,657
1,524
215
7
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.ARB.FramebufferObjectCore -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Po...
haskell-opengl/OpenGLRaw
src/Graphics/GL/ARB/FramebufferObjectCore.hs
bsd-3-clause
3,920
0
5
442
469
294
175
99
0
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TemplateHaskell #-} module Data.Geodetic.HasDoubles( HasDoubles(..) ) where import Papa class HasDoubles a where doubles :: Traversal' a Double instance HasDoubles Double where doubles = id
NICTA/coordinate
src/Data/Geodetic/HasDoubles.hs
bsd-3-clause
256
0
7
49
53
31
22
11
0
import Data.Functor main = do xs <- map read . words <$> getLine :: IO [Int] print $ maximum xs
ksoda/atCoder
a/2.hs
bsd-3-clause
101
1
10
25
51
23
28
4
1
module Experts where import Data.List(mapAccumL, foldl', tails) import Bit import Histogram class Expert a where predict :: a -> Double updateState :: Bool -> a -> a updateModel :: Bool -> a -> a update :: Bool -> a -> a update newB = updateState newB . updateModel newB data ConstantExpert = CE...
cullina/Extractor
src/Experts.hs
bsd-3-clause
2,537
0
12
621
1,315
715
600
55
2
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE DeriveDataTypeab...
wolftune/stack
src/Stack/Setup.hs
bsd-3-clause
51,725
0
31
17,450
11,885
5,938
5,947
1,015
15
{-| The pretty printing for torus types. -} module Torus.Core.Pretty ( Pretty(..) ) where import Data.Text ( Text, unpack ) import Text.PrettyPrint -- | This class captures stuff that can be pretty printed. class Pretty a where pretty :: a -> Doc instance Pretty Text where pretty = text ....
piyush-kurur/torus
Torus/Core/Pretty.hs
bsd-3-clause
328
0
7
82
71
42
29
8
0
-- | -- Module : Crypto.MAC.KMAC -- License : BSD-style -- Maintainer : Olivier Chéron <olivier.cheron@gmail.com> -- Stability : experimental -- Portability : unknown -- -- Provide the KMAC (Keccak Message Authentication Code) algorithm, derived from -- the SHA-3 base algorithm Keccak and defined in NIST SP...
vincenthz/cryptonite
Crypto/MAC/KMAC.hs
bsd-3-clause
5,042
0
20
1,137
1,487
792
695
86
1
module Main where bar = do foo :: String <- baz
mpickering/ghc-exactprint
tests/examples/ghc710/DoPatBind.hs
bsd-3-clause
51
0
8
14
20
11
9
-1
-1
-- | -- Module : Crypto.Hash.Skein512 -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- -- Module containing the binding functions to work with the -- Skein512 cryptographic hash. -- {-# LANGUAGE ForeignFunctionInterface #-} {-...
vincenthz/cryptonite
Crypto/Hash/Skein512.hs
bsd-3-clause
3,366
0
11
838
647
351
296
64
0
{- Copyright 2012-2015 Vidar Holen This file is part of ShellCheck. http://www.vidarholen.net/contents/shellcheck ShellCheck 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...
icyfork/shellcheck
ShellCheck/Regex.hs
gpl-3.0
2,467
0
13
554
549
296
253
35
1
{- (c) The GRASP/AQUA Project, Glasgow University, 1993-1998 \section[WwLib]{A library for the ``worker\/wrapper'' back-end to the strictness analyser} -} {-# LANGUAGE CPP #-} module WwLib ( mkWwBodies, mkWWstr, mkWorkerArgs , deepSplitProductType_maybe, findTypeShape , isWorkerSmallEnough ...
ezyang/ghc
compiler/stranal/WwLib.hs
bsd-3-clause
38,959
0
18
11,323
4,196
2,275
1,921
302
2
{-# LANGUAGE DeriveGeneric #-} module Distribution.Simple.Program.GHC ( GhcOptions(..), GhcMode(..), GhcOptimisation(..), GhcDynLinkMode(..), GhcProfAuto(..), ghcInvocation, renderGhcOptions, runGHC, ) where import Distribution.Compat.Semigroup as Semi import Distribution.Simple.G...
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/Distribution/Simple/Program/GHC.hs
bsd-3-clause
17,265
0
17
4,529
3,275
1,796
1,479
273
26
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE PolyKinds #-} module IHaskell.Display.Widgets.Interactive (interactive, uncurryHList, Rec(...
artuuge/IHaskell
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Interactive.hs
mit
8,503
0
14
1,821
2,542
1,297
1,245
-1
-1
{-# LANGUAGE BangPatterns, TemplateHaskell #-} import Control.Monad import Control.Applicative import Control.Monad.IO.Class (liftIO) import qualified Data.ByteString.Lazy as BSL import Data.Binary (encode, decode) import Remote pingServer :: ProcessM () pingServer = forever $ do them <- expect send them () ping...
tweag/distributed-process
benchmarks/remote/Latency.hs
bsd-3-clause
876
0
10
156
307
153
154
27
1
{-# LANGUAGE Arrows #-} {-# LANGUAGE FlexibleContexts #-} module Main where import qualified QuickCheck import Opaleye.SQLite (Column, Nullable, Query, QueryArr, (.==), (.>)) import qualified Opaleye.SQLite as O import qualified Database.SQLite.Simple as PGS import qualified Data.Profunctor.Product.Defaul...
bergmark/haskell-opaleye
opaleye-sqlite/Test/Test.hs
bsd-3-clause
20,924
4
17
5,204
6,421
3,511
2,910
375
3
module Stackage.Init (stackageInit) where import Data.List (isInfixOf, isPrefixOf) import Stackage.Util import System.FilePath ((</>)) stackageInit :: IO () stackageInit = do c <- getCabalRoot let config = c </> "config" orig <- readFile config -- bypass laziness ...
sinelaw/stackage
Stackage/Init.hs
mit
1,027
0
12
269
274
138
136
25
2
{-# LANGUAGE LambdaCase #-} module NoBlockArgumentsFail3 where import Control.Monad foo :: IO () foo = forM [1 .. 10] \case Just 3 -> print x
shlevy/ghc
testsuite/tests/parser/should_fail/NoBlockArgumentsFail3.hs
bsd-3-clause
146
0
9
29
50
27
23
-1
-1
{- | Module : XMonad.Util.Paste Copyright : (C) 2008 Jérémy Bobbio, gwern License : BSD3 Maintainer : none Stability : unstable Portability : unportable A module for sending key presses to windows. This modules provides generalized and specialized functions for this task. -} module XMonad.Util.Pa...
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Util/Paste.hs
bsd-2-clause
3,244
0
13
896
477
260
217
36
2
{-# LANGUAGE DeriveDataTypeable #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Hooks.DynamicHooks -- Copyright : (c) Braden Shepherdson 2008 -- License : BSD-style (as xmonad) -- -- Maintainer : Braden.Shepherdson@gmail.com -- Stability : uns...
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Hooks/DynamicHooks.hs
bsd-2-clause
3,274
0
20
616
553
317
236
33
1
{-# LANGUAGE CPP #-} -- | Our extended FCode monad. -- We add a mapping from names to CmmExpr, to support local variable names in -- the concrete C-- code. The unique supply of the underlying FCode monad -- is used to grab a new unique for each local variable. -- In C--, a local variable can be declared anywhere wi...
urbanslug/ghc
compiler/codeGen/StgCmmExtCode.hs
bsd-3-clause
7,581
0
15
1,959
1,921
1,027
894
147
3
{-# LANGUAGE MagicHash #-} module ShouldCompile where import GHC.Exts data STRef s a = STRef (MutVar# s a) -- ghc 4.08 had a problem with returning a MutVar#. from :: STRef s a -> MutVar# s a from (STRef x) = x to :: MutVar# s a -> STRef s a to x = STRef x
ryantm/ghc
testsuite/tests/codeGen/should_compile/cg001.hs
bsd-3-clause
263
0
8
62
93
49
44
8
1
module System.Warp.Types where import Data.Map(Map) type Facts = Map String String type GenId = String data ServiceAction = ServiceStop | ServiceStart | ServiceRestart | ServiceReload | ServiceStatus deriving (Show, Read) data Comma...
pyr/warp-agent
System/Warp/Types.hs
isc
2,267
0
9
1,029
466
277
189
50
0
-- Char stands for character (ie. 'a'). A String is a list of characters -- So [Char] is equalant to String (ie. ['A','n','i'] == "Ani"). removeNonUpperCase :: String -> String removeNonUpperCase st = [ c | c <- st, c `elem` ['A'..'Z']] -- Int stands for integer. It’s used for whole numbers. 7 can be an Int but 7.2 --...
dotnetCarpenter/haskell1
ch03/types.hs
isc
1,626
0
8
311
175
101
74
10
1
{-# htermination keysFM_LE :: FiniteMap Bool b -> Bool -> [Bool] #-} import FiniteMap
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/FiniteMap_keysFM_LE_8.hs
mit
86
0
3
14
5
3
2
1
0
module Handler.ReviewNew where import Import import Import import Cache import Form import SessionState import Database.Persist.Sql import qualified Data.List as L getReviewNewR :: Handler Html getReviewNewR = do defaultLayout $ do setTitle "Запрос техсправки" $(widgetFile "tech-request")
swamp-agr/carbuyer-advisor
Handler/ReviewNew.hs
mit
320
0
12
49
71
40
31
13
1
module Sandbox.Number.Extra where -- | Factorial fact :: (Eq a, Num a) => a -> a fact = fact' 1 where fact' s 0 = s fact' s a = fact' (s * a) (a - 1)
4e6/sandbox
haskell/Sandbox/Number/Extra.hs
mit
161
0
9
48
81
44
37
5
2
import Control.Concurrent.STM.TMVar import Control.Concurrent.STM.TQueue import Control.Monad import Control.Monad.STM import Control.Concurrent import Network.Socket.Internal import qualified Data.ByteString.Lazy as B import System.Console.CmdArgs.Implicit import Nntp.Client import Nntp.Types import Nzb.Parser...
Zariel/hewsnet
src/main.hs
mit
1,976
12
13
360
643
329
314
55
2
{- {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExtendedDefaultRules #-} module Main where import Lucid.Base import Lucid.Html5 --import Control.Monoid -} class L t where len :: t -> Int instance L Char where len _ = 1 instance L Bool where len _ = 33 instance L [a] where len xs =...
dominicprior/ghcjs-demos
lu/src/Main.hs
mit
1,141
0
11
277
372
190
182
25
1
module Main where import Memento.CLI import Memento.Logger import Memento.Types import Memento.GoogleCalendar import Memento.HipChat import Memento.Commands import Data.Default import Text.ICalendar.Parser import Options.Applicative import Control.Monad import System.Exit import System.IO import qualified Data.Text as...
adinapoli/memento
main/Main.hs
mit
1,810
0
17
418
462
224
238
51
3
-- Copyright (c) Microsoft. All rights reserved. -- Licensed under the MIT license. See LICENSE file in the project root for full license information. {-# LANGUAGE QuasiQuotes, OverloadedStrings, RecordWildCards #-} {-# OPTIONS_GHC -Wwarn #-} module Bond.Template.Cpp.Util ( openNamespace , closeNamespace ...
innovimax/bond
compiler/Bond/Template/Cpp/Util.hs
mit
5,636
0
14
942
1,286
734
552
-1
-1
module MiniCore.Transforms.StronglyConnectedComponents ( simplifyProgram , simplifyExpr ) where import MiniCore.Types import MiniCore.Transforms.Utils import MiniCore.Format import Control.Monad.State import Control.Applicative import qualified Data.Map as Map import qualified Data.Set as Set import qualified D...
cdparks/mini-core
src/MiniCore/Transforms/StronglyConnectedComponents.hs
mit
4,871
0
16
1,074
1,465
777
688
84
1
-- from ch05 of Real World Haskell -- PrettyJSON.hs module PrettyJSON ( renderJSONValue ) where import Data.Bits (shiftR, (.&.)) import Data.Char (ord) import Numeric (showHex) import Prettify (Doc, char, double, fsep, hcat, punctuate, text, ...
0culus/SimpleJSON
src/PrettyJSON.hs
mit
2,545
0
12
777
749
390
359
49
2
module ParseProblem where {- Paradox/Equinox -- Copyright (c) 2003-2007, Koen Claessen, Niklas Sorensson 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 lim...
msakai/folkung
Haskell/ParseProblem.hs
mit
9,308
0
22
3,205
3,243
1,581
1,662
290
6
module CTG1371Bench (benchmarks) where import CTG1371 import Criterion benchmarks :: [Benchmark] benchmarks = [ bench "main" (nfIO main) ]
danplubell/CTG1371
benchmark/CTG1371Bench.hs
mit
150
0
8
30
42
25
17
6
1
{-| Cluster rebalancer. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later ...
damoxc/ganeti
src/Ganeti/HTools/Program/Hbal.hs
gpl-2.0
15,311
0
19
4,310
3,684
1,854
1,830
306
4
{-# LANGUAGE RelaxedPolyRec, FlexibleContexts, DeriveDataTypeable, TemplateHaskell, CPP, PatternGuards #-} -- Copyright (c) 2004-5 Don Stewart - http://www.cse.unsw.edu.au/~dons -- Copyright (c) 2008 Nicolas Pouillard -- | Vim keymap for Yi. Emulates vim :set nocompatible module Yi.Keymap.Vim (keymapSet, ...
codemac/yi-editor
src/Yi/Keymap/Vim.hs
gpl-2.0
78,123
3
26
26,898
20,808
10,645
10,163
-1
-1