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
-- | -- Module : System.Console.SimpleReadline.Zipper -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- -- a simple zipper implementation -- module System.Console.SimpleReadline.Zipper where data Zipper a = Zipper Int [a] ...
vincenthz/hs-simple-readline
System/Console/SimpleReadline/Zipper.hs
bsd-3-clause
1,938
0
9
451
916
455
461
40
1
module InfoSpec where import CabalApi import Cradle import Data.List (isPrefixOf) import Expectation import Info import Test.Hspec import Types spec :: Spec spec = do describe "typeExpr" $ do it "shows types of the expression and its outers" $ do withDirectory_ "test/data/ghc-mod-check" $ do ...
eagletmt/ghc-mod
test/InfoSpec.hs
bsd-3-clause
1,988
0
19
622
432
208
224
38
1
module RandomUtil.RandomList ( ) where import System.Random
eklinkhammer/neural-algorithms
src/RandomUtil/RandomList.hs
bsd-3-clause
67
0
4
14
14
9
5
3
0
{-# LANGUAGE OverloadedStrings, RecursiveDo, ScopedTypeVariables, FlexibleContexts, TypeFamilies, ConstraintKinds #-} module Frontend.Properties.EC2 ( ec2Properties ) where import Prelude hiding (mapM, mapM_, all, sequence) import qualified Data.Map as Map import Data.Monoid ((<>)) ...
Rizary/awspi
Lib/Frontend/Properties/EC2.hs
bsd-3-clause
2,481
5
16
645
775
399
376
54
4
module Raven.Types ( Identifier , Variable , Operator , Operand , Literal(..) , Function(..) , IfExpression(..) , CondExpression(..) , CaseExpression(..) ...
luc-tielen/raven
src/Raven/Types.hs
bsd-3-clause
3,199
0
7
970
614
381
233
72
0
-- Advent of Code ---- Day 8: Matchsticks module AOC2015.Day08 where -- Decode the string through pattern matching -- read cant be used decode :: String -> String decode ('\\':'\\':xs) = '\\' : decode xs decode ('\\':'"':xs) = '"' : decode xs decode ('\\':'x':_:_:xs) = '!' : decode xs decode ('"':xs) = decode xs deco...
bitrauser/aoc
src/AOC2015/Day08.hs
bsd-3-clause
875
0
10
203
323
164
159
23
1
{-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE Strict #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Graphics.Vulkan.PipelineLayout where import Graphics.Vulkan.Device( VkDevice(..) ) import Data.Word( Word64 , Word32 ) import Foreign.Ptr( Ptr ...
oldmanmike/vulkan
src/Graphics/Vulkan/PipelineLayout.hs
bsd-3-clause
4,571
0
15
1,695
955
554
401
76
0
module System.Build.Access.Extdirs where class Extdirs r where extdirs :: [FilePath] -> r -> r getExtdirs :: r -> [FilePath]
tonymorris/lastik
System/Build/Access/Extdirs.hs
bsd-3-clause
152
0
8
46
45
26
19
9
0
module Netcat ( netcatd , netcat ) where import qualified Data.ByteString as B import Data.ByteString (ByteString) import Control.Monad import Control.Monad.IO.Class import Control.Exception import Network.Simple.TCP netcatdLoop :: Socket -> SockAddr -> IO S...
wangbj/excises
netcat/src/Netcat.hs
bsd-3-clause
1,097
0
12
284
360
188
172
21
2
{-# LANGUAGE OverloadedStrings #-} module DependencyGraphCommandMessagesSpec(spec) where import qualified Data.Map as M import qualified Data.Set as S import Monto.CommandMessage import Monto.DependencyGraphCommandMessages as DGCM import qual...
monto-editor/broker
test/DependencyGraphCommandMessagesSpec.hs
bsd-3-clause
12,370
0
22
2,656
3,059
1,730
1,329
168
1
module Diagrams.Backend.Ipe.Parser where import Diagrams.Backend.Ipe.Types import Text.XML
noinia/diagrams-ipe
src/Diagrams/Backend/Ipe/Parser.hs
bsd-3-clause
93
0
4
9
20
14
6
3
0
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE MultiWayIf #-} -- Author: Lee Ehudin -- Defines tests for the Model module TestModel (modelTests) where import Model.Buffer (ModifyMBuffer, newBuffer, newBufferFromFile, writeBufferToFile, left, right, upLine, downLine, insert, ...
percivalgambit/hasked
test/TestModel.hs
bsd-3-clause
3,328
0
18
1,217
858
431
427
79
3
{-# LANGUAGE BangPatterns #-} module ProcessCabal where import qualified PkgIndexerCore as PC import PackageInfo (PackageInfo(..)) import ParseCabal (parseCabal) import Pipes import qualified Pipes.Prelude as P import TarUtil (ParsedEntry(..), cabalsInArchive, latestVersions) i...
erantapaa/simple-hunt
src/ProcessCabal.hs
bsd-3-clause
1,800
0
17
435
481
256
225
35
3
{-# LANGUAGE CPP #-} #ifdef TRUSTWORTHY {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- -- | -- Module : Control.Lens.Internal.Iso -- Copyright : (C) 2012-2014 Edward Kmett -- License : BSD-style (see the file LICENSE) -- Maintainer : Edw...
hvr/lens
src/Control/Lens/Internal/Iso.hs
bsd-3-clause
2,931
0
8
498
596
347
249
53
0
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-} -- |An efficient implementation of 'Data.Graph.Inductive.Graph.Graph' -- using big-endian patricia tree (i.e. "Data.IntMap"). -- -- This module provides the following specialised functions to gain -- more performance, using GHC's RULES pragma: -- -- * 'Physics.Falling...
sebcrozet/falling
Physics/Falling/Collision/Graph/CollisionGraphTree.hs
bsd-3-clause
7,477
0
15
2,693
2,646
1,409
1,237
135
2
module Data.Validated.Acc where import qualified Data.Validated as V import Control.Applicative data Validated a = Valid a | Doubtful a [String] | Invalid [String] deriving (Eq, Show) messages (Valid _) = [] messages (Doubtful _ ms) = ms messages (Invalid ms) = ms instance Functor ...
arquitecturas-concurrentes/iasc-functors-sample-scala
src/Data/Validated/Acc.hs
mit
769
0
9
238
342
174
168
19
1
-- http://codeforces.com/problemset/problem/1257/B import qualified Data.Map as Map data Case = Case Int Int type History = Map.Map data Response = YES | NO deriving (Show) toCase :: String -> Case toCase line = do let numbers = map read $ words line :: [Int] Case (head numbers) (last numbers) solveWithHisto...
julianespinel/trainning
codeforces/MagicStick.hs
mit
946
0
11
196
301
154
147
19
1
module Squares (sumOfSquares, squareOfSums, difference) where powerSum :: Integral a => a -> a -> a -> a powerSum a b n = (^a) $ sum $ map (^b) [1..n] sumOfSquares :: Integral a => a -> a sumOfSquares = powerSum 1 2 squareOfSums :: Integral a => a -> a squareOfSums = powerSum 2 1 difference :: Integral a => a -> a ...
Bugfry/exercises
exercism/haskell/difference-of-squares/src/Squares.hs
mit
367
0
8
76
163
85
78
9
1
{-# LANGUAGE BangPatterns #-} module Main where import Control.DeepSeq import Control.Exception (evaluate) import Control.Monad.Trans (liftIO) import Criterion.Config import Criterion.Main import Data.List (foldl') import qualified Data.StringMap.Strict as M import Data.Maybe (fromMaybe) import Prelude hiding (lookup)...
alexbiehl/StringMap
benchmarks/StringMap.hs
mit
4,160
0
13
1,018
1,081
569
512
54
1
{-# LANGUAGE FlexibleContexts, Rank2Types, TemplateHaskell, OverloadedStrings, GADTs, DeriveGeneric #-} module SecondTransfer.Sessions.HashableSockAddr ( HashableSockAddr (..) , hashableSockAddrFromNSSockAddr ) where import GHC.Generics (Generic...
shimmercat/second-transfer
hs-src/SecondTransfer/Sessions/HashableSockAddr.hs
bsd-3-clause
1,024
0
9
237
205
122
83
19
1
{-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE ViewPatterns #-} -- | -- Module : Data.Array.Accelerate.CUDA.Context -- Copyright : [2013..2014] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonell -- License : BSD3 -- -- Maintainer : Trevor L. McDonell <tmcdonell@cse.unsw...
tmcdonell/accelerate-cuda
Data/Array/Accelerate/CUDA/Context.hs
bsd-3-clause
5,744
0
15
1,473
1,170
631
539
75
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[InstEnv]{Utilities for typechecking instance declarations} The bits common to TcInstDcls and TcDeriv. -} {-# LANGUAGE CPP, DeriveDataTypeable #-} module ETA.Types.InstEnv ( DFunId, InstMatch, ClsInstLook...
alexander-at-github/eta
compiler/ETA/Types/InstEnv.hs
bsd-3-clause
41,400
0
14
10,750
4,498
2,474
2,024
-1
-1
----------------------------------------------------------------------------- -- Unsigned Integers -- Suitable for use with Hugs 98 on 32 bit systems. ----------------------------------------------------------------------------- module Hugs.Word ( Word , Word8 , Word16 , Word32 , Word64 ) where import Hugs.Prelu...
kaoskorobase/mescaline
resources/hugs/packages/hugsbase/Hugs/Word.hs
gpl-3.0
15,395
104
13
4,350
4,880
2,574
2,306
-1
-1
{-# LANGUAGE CPP #-} module Web.Scotty.Util ( lazyTextToStrictByteString , strictByteStringToLazyText , setContent , setHeaderWith , setStatus , mkResponse , replace , add , addIfNotPresent , socketDescription ) where import Network (Socket, PortID(..), socketPort) import Ne...
adamflott/scotty
Web/Scotty/Util.hs
bsd-3-clause
2,416
0
11
599
725
404
321
52
3
-- (c) The University of Glasgow 2006 {-# LANGUAGE CPP, FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- instance MonadThings is necessarily an -- orphan module TcEnv( TyThing(..), TcTyThing(..), TcId, -- Instance environment, and InstInfo type ...
oldmanmike/ghc
compiler/typecheck/TcEnv.hs
bsd-3-clause
39,840
6
18
11,408
6,715
3,541
3,174
-1
-1
{-# LANGUAGE OverloadedStrings #-} {- Copyright (C) 2006-2010 John MacFarlane <jgm@berkeley.edu> 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) a...
sol/pandoc
src/Text/Pandoc/Writers/Native.hs
gpl-2.0
3,068
0
17
651
621
318
303
39
3
<?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>Directory List v2.3 LC</title> <maps> <homeID>directorylistv2_3_lc</homeID> ...
thc202/zap-extensions
addOns/directorylistv2_3_lc/src/main/javahelp/help_hr_HR/helpset_hr_HR.hs
apache-2.0
984
78
66
158
414
210
204
-1
-1
module ListStarred where import qualified Github.Repos.Starring as Github import Data.List (intercalate) import Data.Maybe (fromMaybe) main = do possibleRepos <- Github.reposStarredBy Nothing "mike-burns" putStrLn $ either (("Error: "++) . show) (intercalate "\n\n" . map formatRepo) ...
bitemyapp/github
samples/Repos/Starring/ListStarred.hs
bsd-3-clause
840
0
17
172
269
138
131
20
1
-- Programatica Front-End Commands, level 1 module Pfe1Cmds where import Prelude hiding (putStr,putStrLn,print) import Pfe0Cmds(pfe0Cmds,runPFE0Cmds) import PfeParse(moduleArg,fileArg,filename,( #@ ), (<@),kwOption) import PFE0(pput,lex0SourceFile,preparseSourceFile,findFile) import DefinedNames import FreeNames impor...
kmate/HaRe
old/tools/pfe/Pfe1Cmds.hs
bsd-3-clause
1,909
0
12
327
522
294
228
-1
-1
module HAD.Y2014.M04.D17.Exercise where {- | countEqualAdjacentPairs Count adjacent pairs (vertical or horizpontal) of values that are equal in a matrix. Examples: >>> countEqualAdjacentPairs [[0,1],[0,2]] 1 >>> countEqualAdjacentPairs [[0,0],[1,2]] 1 >>> countEqualAdjacentPairs [[0,1],[0,0]...
1HaskellADay/1HAD
exercises/HAD/Y2014/M04/D17/Exercise.hs
mit
535
0
8
96
37
23
14
3
1
import PropParser(parse) import HsName(HsName) import HsModule(HsModuleI) import PropSyntax(HsModuleR) import ScopeNamesProp() import NameMapsProp() import TiHsName import ReAssocProp() import TiPropDecorate import PrettyPrint import UTF8Util import System(getArgs) import TiProgram import MUtils import DirUtils main ...
forste/haReFork
tools/property/tstTiProp.hs
bsd-3-clause
523
1
14
71
186
110
76
-1
-1
module Pair () where {-@ LIQUID "--no-termination" @-} import Language.Haskell.Liquid.Prelude data Pair a b = P a b incr x = (x, x+1) chk (x, y) = liquidAssertB (x <y) prop = chk $ incr n where n = choose 0 incr2 x = (x, True, x+1) chk2 (x, _, y) = liquidAssertB (x <y) prop2 = chk2 $ incr2 n where n = ch...
ssaavedra/liquidhaskell
tests/pos/pair0.hs
bsd-3-clause
451
0
8
113
250
141
109
15
1
{-# LANGUAGE Arrows #-} operator = describe "Operators on ProcessA"$ do describe "feedback" $ do it "acts like local variable with hold." $ do let pa = proc evx -> do (\evy -> hold 10 -< evy) `feedback...
ezyang/ghc
testsuite/tests/printer/Ppr025.hs
bsd-3-clause
959
2
28
455
276
144
132
27
1
module A2 where import B2 import C2 import D2 main :: Tree Int ->Bool main t = isSame (sumSquares (fringe t)) (sumSquares (B2.myFringe t)+sumSquares (C2.myFringe t))
kmate/HaRe
test/testdata/Renaming/A2_TokOut.hs
bsd-3-clause
186
0
11
46
79
41
38
7
1
-- Test purpose: -- Ensure that MonadFail warnings are issued correctly if the warning flag -- is enabled {-# OPTIONS_GHC -Wmissing-monadfail-instances #-} module MonadFailWarnings where import Control.Monad.Fail import Control.Monad.ST import Data.Functor.Identity -- should warn, because the do-block gets a gene...
sgillespie/ghc
testsuite/tests/monadfail/MonadFailWarnings.hs
bsd-3-clause
2,113
0
10
466
477
251
226
61
1
{-# LANGUAGE TypeFamilies #-} module ShouldCompile where import Tc251_Help instance Cls Int where inc :: (Fam a ~ Maybe Int) => a -> Fam a -> Fam a inc _proxy (Just x) = Just (x + 1) inc _proxy Nothing = Just 0 foo :: Maybe Int -> Maybe Int foo = inc (undefined :: Int)
ryantm/ghc
testsuite/tests/typecheck/should_compile/tc251.hs
bsd-3-clause
275
0
8
61
120
61
59
9
1
module BoundSource ( BoundSource, create, key, source ) where import Context (Context) import qualified Context import Source (Source) data BoundSource = BoundSource Int Source deriving Show create :: Source -> Context -> (BoundSource, Context) create s ctx = let (id, ctx') = Context.nextKey ctx ...
rcook/hqdsl
src/lib/BoundSource.hs
mit
468
0
10
101
165
92
73
21
1
module Socket where import Data.Maybe (listToMaybe) import Network.Simple.TCP (Socket, SockAddr) import Network.Socket (socketToHandle, HostName, ServiceName, getAddrInfo , defaultHints, socket, AddrInfo (..), SocketType (..), AddrInfoFlag (..), connect) import Control.Exception (catch, displayException, IOExcepti...
TK009/sensorbox
src/Socket.hs
mit
3,504
0
16
957
955
485
470
72
5
{-# LANGUAGE TupleSections, UndecidableInstances, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, GeneralizedNewtypeDeriving, FlexibleContexts #-} module TermGraph where import Prelude hiding ((<>)) import Control.Applicative import Control.Monad import Control.Monad.Except import Control.Monad.Reade...
andreasabel/helf
src/TermGraph.hs
mit
17,626
0
21
5,578
5,673
2,769
2,904
370
9
{-# LANGUAGE RecordWildCards #-} module Crypto.Sodium.Auth.Internal where import Crypto.Sodium.Internal (constantTimeEq, mkHelper, mkSecureHelper) import Crypto.Sodium.Random (randomSecret) import Crypto.Sodium.SecureMem (SecureMem, withSe...
dnaq/crypto-sodium
src/Crypto/Sodium/Auth/Internal.hs
mit
2,584
0
14
954
716
398
318
51
1
doubleMe x = x + x doubleUs x y = doubleMe x + doubleMe y doubleSmallNumber x = if x > 100 then x else x*2 doubleSmallNumber2 x = (if x > 100 then x else x*2) + 1 boomBangs xs = [ if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x]
davidbrowning/4700
cs4700/projects/haskell/myfunction.hs
mit
237
0
8
60
126
65
61
7
2
{-# LANGUAGE OverloadedStrings #-} module Common where import Control.Exception import Control.Monad import Data.ByteString.Lazy (ByteString) import Data.Monoid ((<>)) import Network.Connection import Network.HTTP.Types import Network.Wai import Network.Wai.Handler.Warp import Network.Wai.Handler.WarpTLS import qual...
erikd-ambiata/test-warp-wai
src/Common.hs
mit
3,816
0
22
813
936
475
461
72
2
module Main where import Language.Haskell.Exts.Annotated import Data.Monoid import Opt import Parse import RuntimeSource import CollectData import SymbolTable import BasicTrans import Desugar import DesugarClass import Desugar.Where import Desugar.CaseReorder import Desugar.String import Desugar.List import Desug...
CindyLinz/Haskell.js
trans/src/Main.hs
mit
5,663
0
19
1,457
821
493
328
-1
-1
{-- Lazy Pirate client in Haskell --} module Main where import System.ZMQ4.Monadic import System.Random (randomRIO) import System.Exit (exitSuccess) import Control.Monad (forever, when) import Control.Concurrent (threadDelay) import Data.ByteString.Char8 (pack, unpack) requestRetries = 3 requestTimeout...
soscpd/bee
root/tests/zguide/examples/Haskell/lpclient.hs
mit
1,735
0
15
521
512
255
257
43
4
module Soundgluer (module Soundgluer) where import System.Directory import Control.Monad import qualified Data.Map as M import qualified Data.Text as T -- pack, unpack, takeEnd, dropEnd import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.Builder as B import Codec.Audio.Wave import HspTypes (...
mprzewie/haspell
src/Soundgluer.hs
mit
4,867
0
14
1,349
841
443
398
78
1
------------------------------------------- -- | -- Module : Web.Stripe -- Copyright : (c) David Johnson, 2014 -- Maintainer : djohnson.m@gmail.com -- Stability : experimental -- Portability : POSIX -- -- < https:/\/\stripe.com/docs/api > -- -- @ -- import Web.Stripe -- import Web.Stripe.Account -- -- main ::...
dmjio/stripe
stripe-haskell/src/Web/Stripe.hs
mit
883
0
6
151
114
84
30
11
0
import qualified Data.Map as Map import Data.List import qualified Data.String.Utils as Str import Control.Monad import qualified System.FilePath as Path import System.FilePath ((</>)) import System.Environment (getArgs) import IgrepCashbook import System.Directory (createDirectoryIfMissing) -- general function equal...
igrep/igrep-cashbook
hs/convert-to-cashbook2.hs
mit
2,145
0
17
462
852
447
405
60
4
-- Copyright © 2015 Bart Massey -- [This work is licensed under the "MIT License"] -- Please see the file LICENSE in the source -- distribution of this software for license terms. -- CipherSaber driver for UNIX-like systems with "/dev/random". import Control.Monad import qualified Data.ByteString as BS import qualifi...
BartMassey/ciphersaber2
cs2.hs
mit
3,098
0
18
927
863
445
418
84
5
module Solver where import Data.Maybe import Data.List import Data.List.Split import Control.Arrow import Control.Monad import Sudoku frequency :: Ord a => Line a -> Line (Int, a) frequency = map (length &&& head) . group . sort -- Expects that the Board is a Line of possibilities within same restriction group. uniq...
siers/sudoku-solver
Solver.hs
mit
2,276
0
14
601
708
371
337
38
2
-- | -- Module : Warning.AST -- Copyright : © 2019 Elias Castegren and Kiko Fernandez-Reyes -- License : MIT -- -- Stability : experimental -- Portability : portable -- -- This module includes functionality for creating an Abstract Syntax Tree (AST), -- as well as helper functions for checking differ...
kikofernandez/kikofernandez.github.io
files/monadic-typechecker/typechecker/src/Warning/AST.hs
mit
14,459
0
11
4,059
2,730
1,572
1,158
208
1
module Palindrome where palindrome :: [a] -> [a] palindrome xs = xs ++ reverse xs isPalindrome :: Eq a => [a] -> Bool isPalindrome [] = False isPalindrome xs | odd $ length xs = False | otherwise = xs == reverse xs
bionikspoon/playing-with-haskell---oreilly
ch03/Palindrome.hs
mit
227
0
9
55
100
50
50
8
1
module Settings.Flavours.Quick (quickFlavour) where import Flavour import Expression import Oracles.Flag import {-# SOURCE #-} Settings.Default quickFlavour :: Flavour quickFlavour = defaultFlavour { name = "quick" , args = defaultBuilderArgs <> quickArgs <> defaultPackageArgs , libraryWays ...
izgzhen/hadrian
src/Settings/Flavours/Quick.hs
mit
667
0
11
183
166
96
70
18
1
module Pls where import Data.Maybe import Data.Char import System.FilePath as F import Text.Parsec.Char import Text.ParserCombinators.Parsec import Playlist data PlsLine = Header | Title String | Length Int | File F.FilePath | Entries Int | Version Int deriving Show type PlsFile = [PlsLine] comment :: Parser () com...
fcostantini/PlEb
src/Pls.hs
gpl-3.0
2,917
0
13
953
1,048
500
548
82
2
{-| Module : System.Arte.NetworkTime Description : Types for arte network time Copyright : (c) Greg Hale, 2015 Shea Levy, 2015 License : BSD3 Maintainer : imalsogreg@gmail.com Stability : experimental Portability : GHC, Linux -} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module System...
imalsogreg/arte-ephys
arte-lib/src/System/Arte/NetworkTime.hs
gpl-3.0
2,678
0
11
888
497
270
227
46
3
module Math.Structure.Ring.Semiring where import Prelude hiding ( (+), (-), negate, subtract , (*), (/), recip, (^), (^^) ) import Math.Structure.Additive import Math.Structure.Multiplicative import Math.Structure.Ring.Distributive class ( AdditiveSemigroup r, Multiplica...
martinra/algebraic-structures
src/Math/Structure/Ring/Semiring.hs
gpl-3.0
430
2
8
104
118
76
42
-1
-1
module Application.PVP2LibLinear.ArgsParser where import Data.Maybe import PetaVision.Data.Pooling import System.Console.GetOpt import Text.Parsec import Text.Parsec.String import Text.Read data Flag = PVPFile String | LabelFile String | Thread Int |...
XinhuaZhang/PetaVisionHaskell
Application/PVP2LibLinear/ArgsParser.hs
gpl-3.0
4,705
0
15
1,387
1,339
729
610
140
12
module Strain where keep _ [] = [] keep p (x:xs) = if p x then x : keep p xs else keep p xs discard p = keep (not . p) -- or jusr keep' = filter discard' p = filter (not . p)
ciderpunx/exercismo
src/Strain.hs
gpl-3.0
187
0
7
57
102
53
49
6
2
{-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} module Test.Program.Normalizable where import Control.SessionTypes import Control.SessionTypes.Indexed left_nested_offer :: MonadSession m => m ('Cap ctx (Off '[Off '[Off '[Eps], Eps], Eps])) ('Cap ctx Eps) () left_nested_offe...
Ferdinand-vW/sessiontypes
test/Test/Program/Normalizable.hs
gpl-3.0
1,907
0
19
428
938
480
458
43
2
module Haversine where type Coords = (Double, Double) haversine :: Coords -> Coords -> Double haversine p1 p2 = (2 * radius *) . asin $ sqrt (a + b) where dlat = lat p2 - lat p1 dlong = long p2 - long p1 a = (^2) . sin $ dlat / 2 b = cos (lat p1) * cos (lat p2) * ...
Jiggins/Travelling-Sales-Person
Haversine.hs
gpl-3.0
558
4
12
187
272
147
125
17
1
{- Lazymail state, and operations on it. - - Copyright 2013 Raúl Benencia <rul@kalgan.cc> - - Licensed under the GNU GPL version 3 or higher - -} module Lazymail.State where import Codec.MIME.Type(MIMEValue, nullMIMEValue) import UI.NCurses(ColorID(..), defaultColorID) import System.FilePath import Lazymail.Ty...
rul/lazymail
src/Lazymail/State.hs
gpl-3.0
2,418
0
9
615
519
317
202
69
2
vlen = sqrt . sum . fmap (flip (^) 2)
hmemcpy/milewski-ctfp-pdf
src/content/3.4/code/haskell/snippet01.hs
gpl-3.0
37
0
8
9
27
14
13
1
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} -- | -- Module : Network.AWS.Request -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : provisio...
fmapfmapfmap/amazonka
core/src/Network/AWS/Request.hs
mpl-2.0
4,543
0
13
1,283
1,433
756
677
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dataflow/gen/Network/Google/Resource/Dataflow/Projects/Jobs/WorkItems/Lease.hs
mpl-2.0
6,089
0
20
1,435
872
508
364
134
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/MonitorInstances.hs
mpl-2.0
4,275
0
10
859
503
306
197
60
1
{- zeromq3-conduit - Conduit bindings for zeromq3-haskell - - Copyright (C) 2012 Nicolas Trangez - - 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 Free Software Foundation; either - version 2.1 of the Lice...
rgrinberg/zeromq3-conduit
src/Data/Conduit/ZMQ3.hs
lgpl-2.1
3,205
0
14
756
573
315
258
39
1
{-# LANGUAGE OverloadedStrings #-} module Templates.User where import Data.Text.Encoding (decodeUtf8) import Network.HTTP.Types.Method (methodGet, methodPost, methodPut, methodDelete) import CourseStitch.Templates.Utils import CourseStitch.Templates.Topic signupForm :: Html () signupForm = form_ [action_ "/user", m...
coursestitch/coursestitch-api
src/Templates/User.hs
apache-2.0
986
0
11
195
299
150
149
26
1
module Miscellaneous.A268038Spec (main, spec) where import Test.Hspec import Miscellaneous.A268038 (a268038) main :: IO () main = hspec spec spec :: Spec spec = describe "A268038" $ it "correctly computes the first 20 elements" $ take 20 (map a268038 [1..]) `shouldBe` expectedValue where expectedValue = [...
peterokagey/haskellOEIS
test/Miscellaneous/A268038Spec.hs
apache-2.0
371
0
10
59
180
105
75
10
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} module Language.P4.Walk ( Walkable(..) ) where import Language.P4.AST class Walkable a b where -- | @walk f x@ walks the structure @x@ (bottom up) and replaces every -- occurrence of an @a@ with the result of applying @f@ to it. walk ...
brooksbp/P4
src/Language/P4/Walk.hs
apache-2.0
2,916
0
10
655
1,108
551
557
74
0
module FunFlow.Lib where import Control.Monad.State.Lazy (evalState, runState) import qualified Data.Map.Strict as Map import FunFlow.Ast import FunFlow.Labeling import FunFlow.Parsing import FunFlow.TypeSystem run :: String -> IO () run name = do (ty, cs, e) <- typeCheck <$> parse name putStrLn $ "Analyzing " +...
aochagavia/CompilerConstruction
funflow/src/FunFlow/Lib.hs
apache-2.0
926
0
12
181
287
152
135
23
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE MultiParamTypeClasses #-} import Yesod import Yesod.Auth import Yesod.Form import Yesod.Auth.Kerberos data Kerberos = Kerberos mkYesod "Kerberos" [parseRoutes| / RootR GET /after...
chreekat/yesod
yesod-auth/kerberos.hs
bsd-2-clause
982
0
9
179
219
114
105
29
1
{-| Unittest runner for ganeti-htools. -} {- Copyright (C) 2009, 2011, 2012, 2013 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above c...
ganeti-github-testing/ganeti-test-1
test/hs/htest.hs
bsd-2-clause
5,539
0
12
883
748
494
254
132
1
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE Safe #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE AutoDeriveTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveTraversable #-} module Data.FingerTree.OrderedSequence ...
peddie/fingertrees
src/Data/FingerTree/OrderedSequence.hs
bsd-3-clause
1,923
0
16
508
780
415
365
52
2
module ScreenFile where import Codec.Picture import Data.Functor import Screen readFromGif :: FilePath -> IO ScreenElement readFromGif filename = do gif <- either error id <$> readGifImages filename let elems = map (pixelMap (\ (PixelRGB8 r g b) -> maximum [r,g,b])) gif let n = length elems return $ ...
nomeata/led-display
src/ScreenFile.hs
bsd-3-clause
438
0
16
95
184
94
90
11
1
{-| Code related to Idris's reflection system. This module contains quoters and unquoters along with some supporting datatypes. -} {-# LANGUAGE PatternGuards #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns -fwarn-unused-imports #-} module Idris.Reflection where import Control.Applicative ((<$>), (<*>), pure) import Con...
bkoropoff/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
50,209
0
18
15,868
19,101
9,269
9,832
979
11
module PFDS.Sec9.SegmentedBinary where data DigitBlock = Zeros Int | Ones Int deriving (Show) type Nat = [DigitBlock] zeros :: Int -> Nat -> Nat zeros i [] = [] zeros 0 blks = blks zeros i (Zeros j : blks) = Zeros (i + j) : blks zeros i blks = Zeros i : blks ones :: Int -> Nat -> Nat ones 0 blks = blks ones i (Ones ...
matonix/pfds
src/PFDS/Sec9/SegmentedBinary.hs
bsd-3-clause
619
0
9
156
365
186
179
19
1
{-# LANGUAGE PackageImports, OverloadedStrings #-} import Text.HeX import Text.HeX.Standard as Standard import Docbook as Docbook import Control.Monad (guard, liftM) import Control.Applicative ((<$>)) import qualified Data.Map as M import Text.HeX.Standard.Xml (inTags) import Text.HeX.Standard.TeX (ctl,grp) import Cont...
jgm/HeX
test/test.hs
bsd-3-clause
2,400
0
14
547
517
275
242
40
1
{-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE Strict #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Graphics.Vulkan.CommandPool where import Graphics.Vulkan.Device( VkDevice(..) ) import Data.Word( Word64 , Word32 ...
oldmanmike/vulkan
src/Graphics/Vulkan/CommandPool.hs
bsd-3-clause
3,799
0
12
1,139
671
390
281
62
0
{-# LANGUAGE DeriveFunctor #-} infixl 8 & (&) :: a -> (a -> b) -> b x & f = f x infixl 5 <&> (<&>) :: (Functor f) => f a -> (a -> b) -> f b x <&> f = f <$> x newtype State s a = State { unState :: s -> (s, a) } deriving Functor instance Applicative (State s) where pure x = State $ \s -> (s, x) (State rf) <*>...
sleexyz/haskell-fun
MapReduce.hs
bsd-3-clause
1,144
0
13
435
585
308
277
35
1
{-# LANGUAGE TypeOperators #-} module Zero.Bittrex.Server ( bittrexServer ) where import Servant import Zero.Bittrex.API (BittrexAPI) import Zero.Bittrex.Handlers ------------------------------------------------------------------------------ bittrexServer :: Server Bitt...
et4te/zero
server/src/Zero/Bittrex/Server.hs
bsd-3-clause
362
0
5
77
47
30
17
10
1
-- | -- Module: Elaboration -- Description: - -- Copyright: (c) 2013 Tom Hawkins & Lee Pike module Language.Atom.Elaboration ( -- UeStateT -- * Atom monad and container. Atom , AtomDB (..) , Global (..) , Rule (..) , StateHierarchy (..) , buildAtom -- * Type Aliases and Utilities ...
tomahawkins/atom
Language/Atom/Elaboration.hs
bsd-3-clause
13,873
0
18
4,840
3,938
2,105
1,833
304
4
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE RecursiveDo #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} module Control.Monad.RevState.Class ( MonadRevState (..) , modify , gets ) where import Control.Monad (liftM) import Control.Monad.Fix (Monad...
DanBurton/rev-state
src/Control/Monad/RevState/Class.hs
bsd-3-clause
958
0
15
241
376
206
170
33
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.ARB.InternalformatQuery -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : port...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/InternalformatQuery.hs
bsd-3-clause
766
0
4
88
49
40
9
5
0
------------------------------------------------------------------------------ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} module Snap.Snaplet.Session.Backends.CookieSession ( initCoo...
bitemyapp/snap
src/Snap/Snaplet/Session/Backends/CookieSession.hs
bsd-3-clause
8,256
0
22
2,049
1,522
808
714
113
2
{-# LANGUAGE GADTs #-} module CmmSwitch ( SwitchTargets, mkSwitchTargets, switchTargetsCases, switchTargetsDefault, switchTargetsRange, switchTargetsSigned, mapSwitchTargets, switchTargetsToTable, switchTargetsFallThrough, switchTargetsToList, eqSwitchTargetWith, SwitchPlan(..), targ...
ezyang/ghc
compiler/cmm/CmmSwitch.hs
bsd-3-clause
16,665
0
15
3,486
3,149
1,760
1,389
166
5
----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.SetupWrapper -- Copyright : (c) The University of Glasgow 2006, -- Duncan Coutts 2008 -- -- Maintainer : cabal-devel@haskell.org -- Stability : alpha -- Portability : port...
alphaHeavy/cabal
cabal-install/Distribution/Client/SetupWrapper.hs
bsd-3-clause
14,066
0
17
3,620
2,865
1,514
1,351
256
21
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Targets -- Copyright : (c) Duncan Coutts 2011 -- License : BSD-like -- -- Maintainer : duncan@community.haskell.org -- -- Handling for user-specified targets ----------...
fugyk/cabal
cabal-install/Distribution/Client/Targets.hs
bsd-3-clause
30,561
0
21
8,463
5,681
2,934
2,747
501
14
{-# LANGUAGE BangPatterns, CPP, OverloadedStrings, NoImplicitPrelude #-} #if MIN_VERSION_ghc_prim(0,3,1) {-# LANGUAGE MagicHash #-} #endif {- | Efficiently and correctly parse a JSON string. The string must be encoded as UTF-8. It can be useful to think of parsing as occurring in two phases: * Identification of ...
aelve/json-x
lib/Json/Internal/JsonParser.hs
bsd-3-clause
12,442
0
31
3,798
3,272
1,690
1,582
-1
-1
{-# LANGUAGE FlexibleContexts #-} module Test.SmallCheck.Laws.Functor ( -- * Functor laws identity , composition , compositionSum ) where import Data.Functor.Identity (Identity) import Test.SmallCheck (Property, over) import Test.SmallCheck.Series (Serial, Series) import Test.SmallCheck.Series.Utils (zip...
jdnavarro/smallcheck-laws
Test/SmallCheck/Laws/Functor.hs
bsd-3-clause
1,680
0
15
418
593
317
276
31
1
{- | Module : $Header$ Description : Parser of common logic interchange format Copyright : (c) Karl Luc, DFKI Bremen 2010, Eugen Kuksa and Uni Bremen 2011 License : GPLv2 or higher, see LICENSE.txt Maintainer : eugenk@informatik.uni-bremen.de Stability : provisional Portability : portable Parser ...
keithodulaigh/Hets
CommonLogic/Parse_CLIF.hs
gpl-2.0
13,767
0
25
3,441
4,545
2,247
2,298
351
6
module ErrorFunction where main :: Int main = error "My hoovercraft is full of eels"
roberth/uu-helium
test/runtimeerrors/ErrorFunction.hs
gpl-3.0
88
0
5
18
17
10
7
3
1
{-# LANGUAGE OverloadedStrings, FlexibleContexts, GADTs, ScopedTypeVariables #-} {-| Description: The main graph module. __Start here__. This module is reponsible for parsing the SVG files exported from Inkscape. It also currently acts as a main driver for the whole graph pipeline: 1. Parsing the raw SVG files 2. In...
bell-kelly/courseography
app/Svg/Parser.hs
gpl-3.0
12,947
0
19
4,036
2,849
1,469
1,380
252
5
{- Copyright 2019 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 applicab...
alphalambda/codeworld
codeworld-prediction/tests/prediction-paper.hs
apache-2.0
3,936
0
13
934
1,146
610
536
83
3
-- | This module provides means for reading and applying 'Template's. -- -- Templates are tools to convert items into a string. They are perfectly suited -- for laying out your site. -- -- Let's look at an example template: -- -- > <html> -- > <head> -- > <title>My crazy homepage - $title$</title> -- > ...
d12frosted/hakyll
src/Hakyll/Web/Template.hs
bsd-3-clause
8,421
0
17
2,117
1,164
653
511
87
11
-- | Binding of keys to commands. -- No operation in this module involves the 'State' or 'Action' type. module Game.LambdaHack.Client.UI.KeyBindings ( Binding(..), stdBinding, keyHelp ) where import Control.Arrow (second) import qualified Data.Char as Char import Data.List import qualified Data.Map.Strict as M imp...
Concomitant/LambdaHack
Game/LambdaHack/Client/UI/KeyBindings.hs
bsd-3-clause
7,343
0
19
2,175
1,634
923
711
-1
-1
-- test-list.hs -- example program, testing Float using LeanCheck -- -- Copyright (c) 2017-2020 Rudy Matela. -- Distributed under the 3-Clause BSD licence (see the file LICENSE). import Test.LeanCheck main :: IO () main = do -- identities on floats -- some of these properties fail due to rounding errors checkFor...
rudymatela/llcheck
eg/test-float.hs
bsd-3-clause
1,064
0
16
287
564
290
274
-1
-1
-- | the public API for Instagram access module Instagram ( -- generic types and functions InstagramT ,runInstagramT ,runResourceInIs ,IGException(..) ,IGError(..) -- authentication ,RedirectUri ,getUserAccessTokenURL1 ,getUserAccessTokenURL2 ,Credentials(..) ,OAuthToken(..) ,AccessToken(.....
prowdsponsor/ig
src/Instagram.hs
bsd-3-clause
2,518
0
5
443
507
355
152
102
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module KAT_PubKey.P256 (tests) where import qualified Crypto.PubKey.ECC.Types as ECC import qualified Crypto.PubKey.ECC.Prim as ECC import qualified Crypto.PubKey.ECC.P256 as P256 import Data.ByteArray (Bytes) import Crypto....
tekul/cryptonite
tests/KAT_PubKey/P256.hs
bsd-3-clause
6,329
0
19
1,903
1,819
942
877
121
4
module LCS.Numbers where import LCS.Code -- | http://newton.ex.ac.uk/research/qsystems/collabs/pi/pi3.txt pi :: String pi = "3" ++ "14159265358979323846264338327950288419716939937510" ++ "58209749445923078164062862089986280348253421170679" ++ "82148086513282306647093844609550582231725359408128" ++ "48111745028410...
florianpilz/autotool
src/LCS/Numbers.hs
gpl-2.0
2,551
0
24
140
185
97
88
44
1
-- | Provides transformer categories for injective, surjective, and bijective -- functions. -- -- TODO: Add @Epic@, @Monic@, and @Iso@ categories. module SubHask.Category.Trans.Bijective ( Injective , InjectiveT , unsafeProveInjective , Surjective , SurjectiveT , unsafeProveSurjective , Bije...
abailly/subhask
src/SubHask/Category/Trans/Bijective.hs
bsd-3-clause
4,365
35
14
798
968
509
459
-1
-1
module Throughput.BinaryBuilderDeclarative ( serialize ) where import Data.Monoid import Data.Word import qualified Data.ByteString.Lazy as L import Data.Binary.Builder import Control.Monad import Throughput.Utils serialize :: Int -> Int -> Endian -> Int -> Maybe L.ByteString serialize wordSize chunkSize end ite...
meiersi/blaze-builder
benchmarks/Throughput/BinaryBuilderDeclarative.hs
bsd-3-clause
3,543
0
10
480
661
369
292
40
11