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 RecordWildCards #-} module GCommon.Objects.Transforms ( addPlayer , changePlayerSettings , changePlayerSettingsReset , removePlayer , getPlayer , updatePlayer , moveVehicle , setOrientation , addBullet , addBulletsFromPlayer , addToHealth ) where import Control.Monad.Sta...
cernat-catalin/haskellGame
src/GCommon/Objects/Transforms.hs
bsd-3-clause
5,020
0
26
2,275
1,304
697
607
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Main where import Web.Scotty.Trans (scottyT, ScottyT, ActionT, get, post, json, param, status, middleware, jsonData) import Network.Wai.Middleware.Cors (simpleCors) import Network.HTTP.Types (status200) import Network.URI (URI, parseURI) import Data.Text.Lazy (Text...
svanderbleek/media-server
src/Main.hs
bsd-3-clause
1,844
0
12
379
620
333
287
69
1
main = mapM_ (putStrLn . fizzbuzz) [1..100] fizzbuzz x | x `mod` 15 == 0 = "FizzBuzz" | x `mod` 3 == 0 = "Fizz" | x `mod` 5 == 0 = "Buzz" | otherwise = show x
askl56/Challenges
Maths/02-FizzBuzz/solutions/askl56-fizzbuzz.hs
mit
178
0
9
57
97
49
48
6
1
module Main where import IRTS.CodegenBash import IRTS.Compiler import Idris.AbsSyntax import Idris.ElabDecls import Idris.REPL import System.Environment import System.Exit data Opts = Opts { inputs :: [FilePath] , output :: FilePath } showUsage :: IO () showUsage = do putStrLn "Usage: idris-bash <ibc-files...
wskplho/idris-bash
src/Main.hs
mit
1,025
0
12
256
369
188
181
35
3
{- Copyright 2012-2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed t...
kustomzone/plush
src/Plush/Utilities.hs
apache-2.0
1,951
0
9
375
285
158
127
27
2
{-# LANGUAGE OverloadedLists #-} module Main (main) where import Data.Int (Int32) import Data.Maybe (isJust) import Control.Monad (when) import Control.Monad.IO.Class (liftIO) import qualified Data.Vector.Storable as V import TensorFlow.Core ( unScalar , render , run_ , runSession , run , withC...
tensorflow/haskell
tensorflow-ops/tests/VariableTest.hs
apache-2.0
3,314
0
16
838
938
485
453
84
1
-- Solution to Simultaneous Linear Equations using Matrices import Matrix solveEqns (Matrix coeff) (Matrix const) = (inverse (Matrix coeff)) |><| (Matrix const) main = do putStrLn "\nEnter the coefficient matrix -" mat <- getLine putStrLn "\nEnter the constant matrix -" con <- getLine putStrLn...
rohitjha/DiMPL
examples/lineq.hs
bsd-2-clause
1,268
0
15
207
127
62
65
8
1
{-# LANGUAGE TemplateHaskellQuotes #-} module TH_bracket2 where d_show = [d| data A = A instance Show A where show _ = "A" |]
mpickering/ghc-exactprint
tests/examples/ghc8/TH_bracket2.hs
bsd-3-clause
168
0
4
65
14
11
3
-1
-1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-} module Bookstore ( Bu...
advancedtelematic/quickcheck-state-machine-model
test/Bookstore.hs
bsd-3-clause
16,931
0
19
4,856
5,414
2,793
2,621
-1
-1
{-# LANGUAGE GADTs #-} -- | -- Module : Data.Array.Accelerate.Trafo.Normalise -- Copyright : [2012..2014] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonell -- License : BSD3 -- -- Maintainer : Manuel M T Chakravarty <chak@cse.unsw.edu.au> -- Stability : experimental -- Portability : non-portable...
rrnewton/accelerate
Data/Array/Accelerate/Trafo/Normalise.hs
bsd-3-clause
3,073
0
18
1,187
977
485
492
52
28
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverlappingInstances #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANG...
spacekitteh/compdata
src/Data/Comp/Multi/Variables.hs
bsd-3-clause
8,880
0
20
2,679
2,458
1,301
1,157
133
2
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude, BangPatterns, MagicHash #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Bits -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICE...
rahulmutt/ghcvm
libraries/base/Data/Bits.hs
bsd-3-clause
21,536
0
14
6,304
3,603
2,008
1,595
254
2
{-# LANGUAGE PatternGuards #-} module Idris.DataOpts where -- Forcing, detagging and collapsing import Idris.AbsSyntax import Core.TT import Data.List import Data.Maybe import Debug.Trace -- Calculate the forceable arguments to a constructor and update the set of -- optimisations forceArgs :: Name -> Type -> Idri...
byorgey/Idris-dev
src/Idris/DataOpts.hs
bsd-3-clause
10,452
0
19
4,147
3,795
1,854
1,941
205
15
{-# LANGUAGE OverloadedStrings #-} module VForth.LocationBench where import Criterion.Main import qualified Data.Text as T import TextShow import VForth benchmarks :: [Benchmark] benchmarks = [ bench "length.show" (whnf (T.length . showt) l) , bench "show" (whnf showt l) ] where l = Location { l...
budgefeeney/ventureforth
chap6/bench/VForth/LocationBench.hs
bsd-3-clause
700
0
11
191
130
77
53
18
1
{-# LANGUAGE CPP #-} {-# LANGUAGE InterruptibleFFI #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE NoImplicitPrelude #-} module GHC.IO.Handle.Lock ( FileLockingNotSupported(..) , LockMode(..) , hLock , hTryLock , hUnlock ) where #include "HsBaseConfig.h" import Data.Functor (v...
sdiehl/ghc
libraries/base/GHC/IO/Handle/Lock.hs
bsd-3-clause
2,012
0
8
315
222
145
77
22
1
{-# LANGUAGE Rank2Types #-} {-# LANGUAGE DeriveFunctor #-} module Hans.Lens ( -- * Lenses Lens, Lens', lens, -- ** Getters Getting, Getter, view, to, -- ** Setters ASetter, ASetter', set, over, modify, -- * Utility Lenses bit, byte, ) where import...
GaloisInc/HaNS
src/Hans/Lens.hs
bsd-3-clause
3,267
0
13
810
1,028
577
451
61
2
module Game.Menus where import Data.IORef import Control.Monad.State (get) import Physics.Chipmunk (freeSpace) import Graphics.Qt import Utils import Base import Base.Renderable.Layered import Base.Renderable.StickToBottom import Base.Renderable.Centered import Base.Renderable.CenterHorizontally import Base.Re...
geocurnoff/nikki
src/Game/Menus.hs
lgpl-3.0
6,867
0
18
1,851
1,874
938
936
150
10
-- The lambda-calculus part of the language, which can be shared module Language.Hakaru.Lambda(lit, dbl, lam, app, fix, ifThenElse) where lit :: (Eq a) => a -> a lit = id -- raw lit is a pain to use. These are nicer dbl :: Double -> Double dbl = lit lam :: (a -> b) -> (a -> b) lam f = f app :: (a -> b) -> a -> b a...
bitemyapp/hakaru
Language/Hakaru/Lambda.hs
bsd-3-clause
485
0
9
128
226
126
100
14
1
------------------------------------------------------------------------------- -- | -- Module : System.Hardware.Haskino.Test.ExprBool -- Copyright : (c) University of Kansas -- License : BSD3 -- Stability : experimental -- -- Quick Check tests for Expressions returning a Expr Bool --------------------...
ku-fpg/kansas-amber
tests/ExprTests/ExprBool.hs
bsd-3-clause
4,629
0
15
1,221
1,715
805
910
120
2
{- foo bar -} {- module class X where yyy -}
itchyny/vim-haskell-indent
test/comment/double_block_comments.out.hs
mit
45
0
2
11
4
3
1
1
0
-- Unpack a tarball containing a Cabal package {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} module Distribution.Server.Packages.Unpack ( CombinedTarErrs(..), checkEntries, checkUselessPermissions, unpackPac...
ocharles/hackage-server
Distribution/Server/Packages/Unpack.hs
bsd-3-clause
16,941
0
20
4,005
3,372
1,779
1,593
296
6
----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Dependency -- Copyright : (c) David Himmelstrup 2005, -- Bjorn Bringert 2007 -- Duncan Coutts 2008 -- License : BSD-like -- -- Maintainer : cabal-devel...
trskop/cabal
cabal-install/Distribution/Client/Dependency.hs
bsd-3-clause
33,988
1
19
8,585
5,876
3,202
2,674
587
4
foo :: (() -> () -> [()] -> [()]) -> () -> [()] -> [()] foo k = \_ xs -> concatMap ($ [head xs]) [bar] where bar = let k' = k undefined undefined in \xs -> let k'' = [k' xs] in (() : (foldr1 (>>) k'')) k :: () -> [()] -> [()] k = foo (\_ -> k) --k a = foo (\_ -> k) a -- all the wor...
urbanslug/ghc
testsuite/tests/profiling/should_run/T680.hs
bsd-3-clause
392
0
15
131
230
124
106
13
1
f i = if ?flag then i*2 else i g i = let ?flag=False in f i
ghc-android/ghc
testsuite/tests/ghci.debugger/scripts/break015.hs
bsd-3-clause
61
0
8
18
43
21
22
-1
-1
{- HAAP: Haskell Automated Assessment Platform This module provides a miscellaneous utility functions. -} module HAAP.Utils where import Data.Map (Map(..)) import qualified Data.Map as Map import Data.Time.LocalTime import Data.Time.Calendar import Data.Time.Format import Data.Csv import Data.Char import Data.List i...
hpacheco/HAAP
src/HAAP/Utils.hs
mit
5,134
0
13
1,081
2,671
1,432
1,239
144
3
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module System.ImportGraph.ModuleCluster where import Avail import ClassyPrelude import Data.GraphViz import Data.GraphViz.Attributes.Complete import Data.GraphViz.Ty...
ncaq/haskell-import-graph
lib/System/ImportGraph/ModuleCluster.hs
mit
1,721
0
15
324
494
253
241
38
1
{-# LANGUAGE StandaloneDeriving, FlexibleInstances #-} module Derivation where import qualified Prelude as P import Lib c2hl :: List a -> [a] c2hl Nil = [] c2hl (Cons x xs) = x : (c2hl xs) deriving instance (P.Eq Cand) deriving instance (P.Ord Cand) deriving instance (P.Show Cand) deriving instance (P.Show Bool) deri...
mukeshtiwari/formalized-voting
paper-code/schulze-voting/src/Derivation.hs
mit
4,381
0
22
985
2,031
1,021
1,010
75
3
-- {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE DeriveDataTypeable #-} module Main where -- import Data.Word import qualified EdaxProtocol import System.IO import System.Environment(getArgs, getProgName) import System.Console.GetOpt import Text.Printf -- foreign export ccall search :: Word64 -> Word64 -> In...
ysnrkdm/Hamlet
src/Main.hs
mit
1,877
0
15
425
443
233
210
40
4
module Graphics.Urho3D.Graphics.Internal.Camera( Camera , ViewOverride(..) , ViewOverrideFlags , cameraCntx ) where import qualified Language.C.Inline as C import qualified Language.C.Inline.Context as C import qualified Language.C.Types as C import Data.Word import GHC.Generics import Graphics.Urho3D.Con...
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Graphics/Internal/Camera.hs
mit
1,204
0
11
224
270
162
108
-1
-1
module Main where sortTuple (l, []) lt = (l, []) sortTuple (s, h:t) lt = sortTuple ((filter (fixed_lt) s) ++ [h] ++ (filter (not . fixed_lt) s), t) lt where fixed_lt = (\x -> (lt x) h) sortBy l lt = fst (sortTuple ([], l) lt) sort l = sortBy l (<)
henryaddison/7-lang-7-weeks
week7-haskell/2/sort.hs
mit
262
0
11
66
166
91
75
6
1
module ListTransformations (dropItem, dropDouble) where -- deletes the item from the list -- dropItem '/' "/home/i/test/" -> "homeitest" dropItem :: (Eq a) => a -> [a] -> [a] dropItem i = foldr (\x y -> if x == i then y else x : y) [] -- cuts the list from the start to front until end and drops everything else -- ...
cirquit/Personal-Repository
Haskell/RWH/Lists/ListTransformations.hs
mit
553
0
9
162
160
88
72
7
2
module Distribution.Compat.Filesystem.Posix (pathSeparator, pathSeparators, pathCoerceToDirectory, pathCoerceToFile, pathIsAbsolute, pathIsRelative, pathIsDirectory, pathIsFile, (</>), removeFileSilently, removeDirectorySilently, removeDirectoryRecursiveSilently, listDirectory) w...
IreneKnapp/cabal-app
Distribution/Compat/Filesystem/Posix.hs
mit
2,040
0
20
576
485
251
234
62
4
module Web.Kirstie.Hook ( afterSaveHooks , beforeSaveHooks ) where import Web.Kirstie.Model import Web.Kirstie.Hooks.RelatedPosts import Web.Kirstie.Hooks.AtomFeed import Web.Kirstie.Hooks.XmlSitemap import Web.Kirstie.Hooks.AmazonAssociates import Web.Kirstie.Hooks.TagArchives import Web.Kirstie.Hooks.Arc...
hekt/blog-system
src/Web/Kirstie/Hook.hs
mit
671
0
9
174
140
89
51
18
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.CharacterData (js_substringData, substringData, js_appendData, appendData, js_insertData, insertData, js_deleteData, deleteData, js_replaceData, replaceData, js_setData, setData, js_getData,...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/CharacterData.hs
mit
4,976
70
11
849
1,174
649
525
82
1
{- ================================================================================ The proper divisors of a number are all the divisors excluding the number itself. For example, the proper divisors of 28 are 1, 2, 4, 7, and 14. As the sum of these divisors is equal to 28, we call it a perfect number. Interestingly th...
dpieroux/euler
0/0095.hs
mit
5,396
0
19
1,799
1,379
735
644
-1
-1
module CommandLineParser ( Command (..) , parseCommandLine ) where import Control.Applicative ((<$>), (*>), (<*), (<*>)) import Control.Monad (void) import Network.Traffic.Object ( EnumerationTarget (..) , FilterFunc (..) , filterFunc ...
kosmoskatten/traffic-analysis
src/CommandLineParser.hs
mit
2,636
0
18
896
705
360
345
78
2
-- expandiendo_un_circulo.hs -- Expandiendo un círculo. -- José A. Alonso Jiménez <jalonso@us.es> -- Sevilla, 21 de Mayo de 2013 -- --------------------------------------------------------------------- import Graphics.Gloss main :: IO () main = animate (InWindow "Expandiendo un circulo" (1800,820) (90,90)) ...
jaalonso/I1M-Cod-Temas
src/Tema_27/expandiendo_un_circulo.hs
gpl-2.0
547
0
10
94
94
53
41
6
1
module Cluster (Cluster, emptyCluster, createCluster, blocksInCluster, isClusterEmpty, doClustersClash, isClusterWithinArea, moveClusterInDirection, joinClusters, rotateCluster...
pavelfatin/haskell-blocks
src/Cluster.hs
gpl-3.0
2,303
0
14
525
730
386
344
48
1
#!/usr/bin/env runhaskell {-# LANGUAGE UnicodeSyntax #-} import Prelude.Unicode import Data.Bool (bool) import Data.Monoid.Unicode ((⊕)) import Data.Char (isSpace) import Data.List (dropWhileEnd) import Control.Applicative (liftA2) modifyLines ∷ Bool → [String] → [String] modifyLines False [] = [] modifyLines True []...
39aldo39/klfc
scripts/Usage.hs
gpl-3.0
1,366
0
15
237
581
303
278
28
2
module Test where import Data.List {- Syntax -} -- redundant f :: Int f = if True then 1 else 2 f' :: Int f' = if True then 1 else 1 f1 :: Int f1 = (1 + 2) -- error g :: Int g = "aaa"
mumuxme/vim-config
test/test.hs
gpl-3.0
222
0
6
86
75
47
28
14
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-firestore/gen/Network/Google/Resource/FireStore/Projects/Databases/Documents/PartitionQuery.hs
mpl-2.0
6,488
0
16
1,374
790
465
325
121
1
-- brittany { lconfig_indentAmount: 8, lconfig_indentPolicy: IndentPolicyMultiple } foo = do let aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa foo foo = do let aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaa...
lspitzner/brittany
data/Test356.hs
agpl-3.0
457
0
11
142
48
23
25
10
1
-- The real Setup file for a Gtk2Hs package (invoked via the SetupWrapper). -- It contains only adjustments specific to this package, -- all Gtk2Hs-specific boilerplate is kept in Gtk2HsSetup.hs -- which should be kept identical across all packages. -- import Gtk2HsSetup ( gtk2hsUserHooks, checkGtk2hsBuildtools ) impor...
haasn/haskell-vte
SetupMain.hs
lgpl-2.1
499
0
8
68
53
31
22
5
1
{- Copyright 2015 Tristan Aubrey-Jones Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
flocc-net/flocc
v0.1/Compiler/Types/Variables.hs
apache-2.0
3,231
0
15
562
620
343
277
33
2
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="pt-BR"> <title>Technology detection | ZAP Extension</title> <maps> <homeID>top</homeID> ...
0xkasun/security-tools
src/org/zaproxy/zap/extension/wappalyzer/resources/help_pt_BR/helpset_pt_BR.hs
apache-2.0
985
80
66
160
415
210
205
-1
-1
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE ScopedTypeVariables #-} module Data.Container.Poly where --import Prologue hiding (Ixed, Indexed, S...
wdanilo/container
src/Data/Container/Poly.hs
apache-2.0
25,747
0
11
10,231
548
472
76
-1
-1
{- Copyright 2016-2017 The CodeWorld Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by app...
nomeata/codeworld
codeworld-prediction/src/Data/MultiMap.hs
apache-2.0
2,412
0
13
469
716
383
333
27
1
import Data.List g n = [n, n+1, n+2,n+9,n+10,n+11,n+18,n+19,n+20] h n = map (\i -> i * 9 + n) [0..8] gp = [ [ 0.. 8], [ 9..17], [18..26], [27..35], [36..44], [45..53], [54..62], [63..71], [72..80], (g 0), (g 3), (g 6), (g 27), (g 30), (g 33), (g 54), (g 57), (g 60), (h 0), (h 1), (h 2), (h 3), (h 4), (h...
a143753/AOJ
0126.hs
apache-2.0
1,168
0
16
373
899
476
423
41
2
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QFont.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:20 Warning : this file is machine generated - do not mod...
uduki/hsQt
Qtc/Gui/QFont.hs
bsd-2-clause
19,540
0
15
3,506
6,821
3,502
3,319
-1
-1
module Blinker where import CLaSH.Prelude {-# ANN topEntity (defTop { t_name = "blinker" , t_inputs = ["KEY1"] , t_outputs = ["LED"] , t_extraIn = [ ("CLOCK_50", 1) , ("KEY0" , 1) ] , t_clocks = [ altpll "altpll50" "CLOCK_50(0)" "not KEY0(0)" ] ...
ggreif/clash-compiler
examples/Blinker.hs
bsd-2-clause
948
0
10
331
207
109
98
-1
-1
module Main ( main ) where import qualified Iron.Executables.Ironc main :: IO () main = Iron.Executables.Ironc.main
iron-codegen/iron
executables/ironc/Main.hs
bsd-3-clause
122
0
6
22
35
22
13
5
1
{- | Allow monad transformers to be run/eval/exec in a section of conduit rather then needing to run across the whole conduit. The circumvents many of the problems with breaking the monad transformer laws. Read more about when the monad transformer laws are broken: <https://github.com/snoyberg/conduit/wiki/Dealing-wit...
Davorak/conduit-lift
src/Data/Conduit/Lift.hs
bsd-3-clause
7,058
0
15
1,915
2,571
1,333
1,238
172
2
{-# LANGUAGE ForeignFunctionInterface #-} module Send ( bsSend , rawSend ) where import Control.Monad (when) import Data.ByteString.Internal import Foreign.C.Error (eAGAIN, getErrno, throwErrno) import Foreign.C.Types import Foreign.ForeignPtr (withForeignPtr) import Foreign.Ptr (Ptr, plusPtr, castPtr) import...
kazu-yamamoto/witty
src/Send.hs
bsd-3-clause
1,539
0
17
379
481
256
225
41
3
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Text.RE.LineNo where newtype LineNo = ZeroBasedLineNo { getZeroBasedLineNo :: Int } deriving (Show,Enum) firstLine :: LineNo firstLine = ZeroBasedLineNo 0 getLineNo :: LineNo -> Int getLineNo = (+1) . getZeroBasedLineNo lineNo :: Int -> LineNo lineNo = Zer...
cdornan/idiot
Text/RE/LineNo.hs
bsd-3-clause
345
0
8
58
97
58
39
11
1
module ExceptionLang.Parser ( expression , program , parseProgram ) where import Control.Monad (void) import Data.Maybe (fromMaybe) import ExceptionLang.Data import Text.Megaparsec import Text.Megaparsec.Expr import qualified Text.Megaparsec.Lexer ...
li-zhirui/EoplLangs
src/ExceptionLang/Parser.hs
bsd-3-clause
6,098
0
13
1,477
1,639
855
784
168
2
{-# LANGUAGE OverloadedStrings #-} -- | -- Module : Network.TLS.Handshake.Signature -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- module Network.TLS.Handshake.Signature ( certificateVerifyCreate , certificateV...
AaronFriel/hs-tls
core/Network/TLS/Handshake/Signature.hs
bsd-3-clause
8,536
0
20
2,551
1,758
881
877
152
7
{-# LANGUAGE OverloadedStrings #-} module JKF.Parser.Kif.Internal where import Control.Applicative ((<$>), (<*>)) import Data.Char (digitToInt) import Data.Maybe (isNothing) import Data.Text ...
suzuki-shin/jkf-hs
src/JKF/Parser/Kif/Internal.hs
bsd-3-clause
3,457
0
21
945
1,263
609
654
108
3
{-# OPTIONS_GHC -F -pgmF htfpp #-} {- haskell-librsync - an attempt to write a Haskell library to read/write /apply rdiff patches etc. Presently lives inside the source code for rdifffs and only implements the minimum necessary to support that program: namely parsing and applying rdiff patches. ...
jmtd/rdifffs
Test.hs
bsd-3-clause
1,784
0
13
327
401
216
185
28
1
{-+ Type environments. For efficiency, a type environment is represented as a pair of an environment and the set of (nongeneric) type variables that occur free in the environment. The type checker needs this information when it generalizes a type, and traversing the whole environment every time is too costly. -} modul...
forste/haReFork
tools/base/TI/TiTEnv.hs
bsd-3-clause
1,212
0
12
210
376
206
170
-1
-1
{-| An encoding of the error function and plotting example enclosures. -} module TestSineCosine where -- Doubles as interval endpoints: import Numeric.AERN.RealArithmetic.Basis.Double () -- intervals generic in the type of its endpoints: import Numeric.AERN.Basics.Interval (Interval(..)) -- interval-coeffic...
michalkonecny/aern
aern-poly-plot-gtk/demos/TestSineCosine.hs
bsd-3-clause
9,562
0
11
3,188
1,707
1,057
650
169
1
module Main(main) where import System.Environment import TagSoup.Sample import TagSoup.Test import TagSoup.Benchmark import Data.Char(toLower) helpMsg :: IO () helpMsg = putStr $ unlines $ ["TagSoup, (C) Neil Mitchell 2006-2009" ,"" ," tagsoup arguments" ,"" ,"<url> may either be a local file, ...
ndmitchell/tagsoup
test/Main.hs
bsd-3-clause
2,333
0
15
667
789
432
357
53
6
-- ----------------------------------------------------------------------------- -- Syntax.hs, part of Luthor -- -- (c) Edward Kmett 2010 -- Based on AbsSyn.hs from 'alex' (c) Chris Dornan 1995-2000, Simon Marlow 2003 -- ----------------------------------------------------------------------------} module Text.Luthor.S...
ekmett/luthor
Text/Luthor/Syntax.hs
bsd-3-clause
2,890
0
14
809
882
487
395
77
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} #if MIN_VERSION_base(4,9,0) {-# OPTIONS_GHC -fno-warn-redundant-constraints #-} #endif ----------------------------------------------------------------------------- -- | -- Module : Text.CSL.Eval.Common -- Copyrig...
jgm/pandoc-citeproc
src/Text/CSL/Eval/Common.hs
bsd-3-clause
7,320
0
19
2,346
2,143
1,140
1,003
148
3
{-| Module : Utils.Test.EnforceRange Description : squash generated numbers to a given range Copyright : (c) Michal Konecny License : BSD3 Maintainer : mikkonecny@gmail.com Stability : experimental Portability : portable Utility for squashing randomly generated num...
michalkonecny/mixed-types-num
src/Utils/Test/EnforceRange.hs
bsd-3-clause
1,989
0
11
453
487
263
224
-1
-1
{-# LANGUAGE FlexibleContexts #-} module OfficeClimate.Connection ( connect , run , runI ) where import Database.HDBC.PostgreSQL (connectPostgreSQL, Connection) import Database.HDBC (IConnection, SqlValue) import Database.Record (FromSql, ToSql) import Database.HDBC.Record.Query (runQuery) import Database.HDB...
igrep/office-climate
src/OfficeClimate/Connection.hs
bsd-3-clause
1,000
0
10
176
335
175
160
28
1
{-# LANGUAGE CPP #-} module React.Flux.Mui.Util where import Protolude import Data.Aeson import qualified Data.HashMap.Strict as HashMap import React.Flux #ifdef __GHCJS__ import Data.JSString.Text import Data.JSString (JSString) #else import Data.String (S...
pbogdan/react-flux-mui
gen/templates/Util.hs
bsd-3-clause
642
0
15
167
162
94
68
16
2
{- Originally from: http://5outh.blogspot.com/2013/05/symbolic-calculus-in-haskell.html -} module Data.Expression where import Prelude (Eq, Show, String, error, id, otherwise, show, undefined, ($), (++), (==)) import Domains.Applicable import Domains.Exponentiative import ...
pmilne/algebra
src/Data/Expression.hs
bsd-3-clause
6,038
0
12
1,888
2,807
1,365
1,442
206
10
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} {-# LAN...
JPMoresmau/haskell-ide-engine
hie-plugin-api/Haskell/Ide/Engine/PluginDescriptor.hs
bsd-3-clause
7,470
0
16
1,798
1,356
780
576
-1
-1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DataKinds #-} -------------------------------------------------------------------------------- -- | -- Module : Database.EventStore.Internal.Operation.Identify -- Copyright : (C) 2017 Yorick Laupa -- License : (see the file LICENSE) -- Maintainer: Yorick Laupa <y...
YoEight/eventstore
Database/EventStore/Internal/Operation/Identify.hs
bsd-3-clause
1,983
0
13
353
276
160
116
-1
-1
main :: IO Int main = return (42)
alanz/haskell-lsp
lsp-test/test/data/refactor/Main.hs
mit
34
0
6
8
20
10
10
2
1
module Evict where data EvictionState = LRU eviction_init :: EvictionState eviction_init = LRU eviction_update :: EvictionState -> Integer -> EvictionState eviction_update s _ = s eviction_choose :: EvictionState -> (Integer, EvictionState) eviction_choose s = (0, s)
mit-pdos/fscq-impl
src/hslib/Evict.hs
mit
274
0
6
42
73
42
31
9
1
{-# LANGUAGE DeriveDataTypeable #-} module InnerEar.Exercises.FiveBandBoostCut (fiveBandBoostCutExercise) where import Reflex import Reflex.Dom import Data.Map import Data.List (elemIndex,findIndices) import System.Random import Text.JSON import Text.JSON.Generic import InnerEar.Widgets.Config import InnerEar.Widget...
JamieBeverley/InnerEar
src/InnerEar/Exercises/FiveBandBoostCut.hs
gpl-3.0
3,738
0
15
559
1,087
585
502
70
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-codepipeline/gen/Network/AWS/CodePipeline/EnableStageTransition.hs
mpl-2.0
4,848
0
12
996
564
339
225
80
1
{-# LANGUAGE OverloadedStrings #-} -- Module : Test.AWS.Lambda -- Copyright : (c) 2013-2015 Brendan Hay -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or -- y...
fmapfmapfmap/amazonka
amazonka-lambda/test/Test/AWS/Lambda.hs
mpl-2.0
736
0
5
201
73
50
23
11
1
module Main where import System.Console.GetOpt import System.Environment import System.Exit import System.IO import Data.Aeson import Data.ByteString.Lazy.Char8 (pack) import qualified Data.IntMap as M import Data.Maybe import ...
ulricha/dsh
src/Database/DSH/Tools/VSLDotGen.hs
bsd-3-clause
2,143
0
17
806
567
306
261
54
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-s3/gen/Network/AWS/S3/GetBucketVersioning.hs
mpl-2.0
4,125
0
9
862
524
314
210
63
1
import System.Plugins import System.Directory a = "Foo.hs" -- user code b = "Bar.hs" -- more user code z = "Stub.hs" -- and a stub main = do status <- makeWith a z [] s <- case status of MakeFailure e -> mapM_ putStrLn e >> error "failed" MakeSuccess n s ->...
abuiles/turbinado-blog
tmp/dependencies/hs-plugins-1.3.1/testsuite/makewith/multi_make/Main.hs
bsd-3-clause
1,137
0
12
439
350
162
188
25
5
main f g xs = map f (map g xs) map f xs = case xs of [] -> [] y:ys -> f y : map f ys
ndmitchell/tagsoup
test/TagSoup/Generate/programs/MapMap.hs
bsd-3-clause
97
0
9
40
72
34
38
4
2
module LayoutIn3a where --Layout rule applies after 'where','let','do' and 'of' --In this Example: rename 'x' after 'let' to 'anotherX'. foo x = let x = 12 in ( x ) where y = 2 --there is a comment. ...
mpickering/ghc-exactprint
tests/examples/transform/LayoutIn3a.hs
bsd-3-clause
530
0
12
348
63
35
28
5
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Data.Conduit.Process.Unix ( -- * Process tracking -- $processTracker -- ** Types ...
telser/keter
Data/Conduit/Process/Unix.hs
mit
12,780
2
32
4,992
2,560
1,376
1,184
234
6
module Sum where import Prelude hiding (sum) fun1 = x + x sum c [] = 0 sum c ((h : t)) = c h (sum c t) main = sum (+) [1 .. 4]
kmate/HaRe
old/testing/generaliseDef/Sum_AstOut.hs
bsd-3-clause
132
0
8
40
85
48
37
6
1
import StackTest main :: IO () main = do stackErr ["build", "files-3"] stackErr ["build", "files-0.1.0.0"] stack ["build", "files"] stack ["build", "."]
AndreasPK/stack
test/integration/tests/606-local-version-not-exist/Main.hs
bsd-3-clause
170
0
8
38
67
34
33
7
1
{-# LANGUAGE RoleAnnotations #-} module T10285a (N, coercion) where import Data.Type.Coercion newtype N a = MkN Int type role N representational coercion :: Coercion (N a) (N b) coercion = Coercion
urbanslug/ghc
testsuite/tests/typecheck/should_fail/T10285a.hs
bsd-3-clause
202
0
7
35
61
37
24
7
1
import Control.Exception as E import Data.IORef import System.Mem.Weak import Control.Concurrent main :: IO () main = do ref <- newIORef 'x' weak <- mkWeakIORef ref $ putStrLn "IORef finalized" let check = deRefWeak weak >>= \m -> case m of Nothing -> putStrLn "IORef was GCed" Just ...
urbanslug/ghc
testsuite/tests/concurrent/should_run/T7970.hs
bsd-3-clause
616
0
18
191
193
92
101
19
2
module Main where fizzbuzz :: (Show a, Integral a) => a -> String fizzbuzz n | fizz == 0 && buzz == 0 = "FizzBuzz" | fizz == 0 = "Fizz" | buzz == 0 = "Buzz" | otherwise = show n where fizz = n `mod` 3 buzz = n `mod` 5 main = do putStrLn "Fizzbuzz 3:" putStrLn $ fizzbuzz 3 putStrLn "Fizzbuzz 5:"...
archdragon/haskell_exercises
fizz_buzz/fizz_buzz.hs
mit
500
0
10
130
201
93
108
20
1
{-# LANGUAGE ForeignFunctionInterface #-} module System.Environment.FindBin ( __Bin__ , getProgPath ) where import Foreign (Ptr, alloca, peek, peekElemOff) import Foreign.C (CInt, CString, peekCString) import System.Directory (canonicalizePath, findExecutable) import System.FilePath (takeDirectory, takeBa...
audreyt/findbin
src/System/Environment/FindBin.hs
mit
2,686
0
29
911
667
328
339
55
8
{-# htermination realToFrac :: Int -> Float #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_realToFrac_2.hs
mit
48
0
2
8
3
2
1
1
0
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeSynonymInstances #-} module Gate where import BigGate import Data.Bits import NotGate import Types -- type GateCounter = [Int] andGate :: SecureGate andGate = bigGate AND orGate :: Secu...
ur-crypto/sec-lib
library/Gate.hs
mit
1,049
0
10
313
267
147
120
31
1
{-# htermination denominator :: Ratio Int -> Int #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_denominator_1.hs
mit
53
0
2
9
3
2
1
1
0
module Paradox.Instantiate where {- Paradox -- 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 limi...
msakai/folkung
Haskell/Paradox/Instantiate.hs
mit
6,877
0
29
2,715
2,303
1,242
1,061
148
6
{-# LANGUAGE ViewPatterns #-} module FunctorLaws ( functorCompose' ) where import Test.QuickCheck import Test.QuickCheck.Function functorCompose'::(Eq (f c), Functor f) => f a -> Fun a b -> Fun b c -> Bool functorCompose' x (Fun _ f) (Fun _ g) = (fmap (g . f) x) == (fmap g . fmap f $ x)
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter16.hsproj/FunctorLaws.hs
mit
296
0
9
62
136
71
65
7
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module Lib where import Control.Applicative import Database.SQLite.Simple import qualified Data.Text as T import Web.Scotty import Network.Wai.Middleware.RequestLogger import Control.Monad.IO.Class import Data.Aeson hiding(json) import GHC.Generics imp...
jean-lopes/todo
src/Lib.hs
mit
3,075
0
17
915
670
328
342
59
1
-- file ch03/ex06.hs -- Create a function that sorts a list of lists based on the length of each -- sublist. (You may want to look at the sortBy function from the Data.List -- module.) import Data.List longer :: [a] -> [b] -> Ordering longer a b | length(a) > length(b) = GT | length(a) < length(b) = LT | ...
imrehg/rwhaskell
ch03/ex06.hs
mit
451
0
10
110
166
87
79
8
1
{-# OPTIONS_HADDOCK hide, prune #-} {-# Language CPP #-} module Foundation ( module Foundation , parseSqlKey ) where #if DEVELOPMENT import qualified Prelude import qualified Language.Haskell.TH as TH import qualified Language.Haskell.TH.Quote as TH #endif import Control.Concurrent.STM.TChan import qualifi...
achirkin/qua-kit
apps/hs/qua-server/src/Foundation.hs
mit
22,747
0
19
5,952
4,790
2,464
2,326
-1
-1
-- Set Comprehensions -- To create a list comprehension we define a rule for every X and then the group from which we'll pick our Xs firstTenEvens = [x * 2 | x <- [1..10]] -- Now let's get all elements that doubled are greater than or equal to 12 -- This time we will also need a condition after the input group greate...
lucasfcosta/haskell-experiences
Chapter 2/setComprehensions.hs
mit
1,018
0
8
200
206
112
94
6
2
{-# htermination notElem :: Eq a => (Maybe a) -> [(Maybe a)] -> Bool #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_notElem_10.hs
mit
73
0
2
15
3
2
1
1
0
{-# LANGUAGE OverloadedStrings #-} module Proxy where import qualified Logger as L import qualified Data.ByteString.Char8 as B import qualified Network.BSD as NBSD import Network.Wai import Network.HTTP.Types import Network.HTTP.Types.Header import Network.Wai.Handler.Warp (run) import qualified Network.HTTP.Client as...
troydm/paranoia
src/Proxy.hs
mit
10,093
0
26
4,365
2,284
1,165
1,119
137
6
import Data.Array.Unboxed improve :: Array (Int, Int) Int -> Array (Int, Int) Int -> Array (Int, Int) Int improve path cost = array (bounds path) ( ((i0, j0), cost!(i0, j0)) : ((i0, j1), path!(i0, j1) `min` (cost!(i0,j1) + minTopRight)) : ((i1, j0), path!(i1, j0) `min` (cost!(i1,j0) + minBottomLeft))...
dpieroux/euler
0/0083.hs
mit
2,446
0
20
577
1,635
936
699
43
2
{-# LANGUAGE GeneralizedNewtypeDeriving, PatternGuards, DeriveDataTypeable #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RankNTypes #-} module Test.Tasty.Silver.Interactive.Run ( wrapRunTest ) where import Data.Tagged import Data.Typeable import Test.Tasty hidi...
phile314/tasty-silver
Test/Tasty/Silver/Interactive/Run.hs
mit
1,666
0
18
298
588
310
278
34
1
{-# LANGUAGE DerivingVia #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE RecordWildCards #-} module Unison.Codebase.FileCodebase.Branch.Dependencies where import Data.Set (Set) import Data.Foldable (toList) import qualified Data.Set as Set import qualified Data.Map as Map import Unison.Codebase.Branch (Branch(Branch)...
unisonweb/platform
parser-typechecker/src/Unison/Codebase/FileCodebase/Branch/Dependencies.hs
mit
3,576
0
16
641
1,236
663
573
-1
-1