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 #-} {-# LANGUAGE OverloadedStrings #-} module Test.Snapshots (spec) where import Test.Common import Test.Import import Data.Maybe (fromMaybe) import qualified Data.List as L import qualified Data.HashMap.Strict as HM import qualified Data.Text as T import qualified Data.Vector as V imp...
bitemyapp/bloodhound
tests/Test/Snapshots.hs
bsd-3-clause
8,736
0
30
2,449
2,276
1,073
1,203
160
8
module Type where import qualified Data.List as List -- Datatype that represents MinCaml types. data Type = TUnit | TBool | TInt | TFloat | TFun ![Type] !Type -- arguments are uncurried | TTuple ![Type] | TArray !Type | TVar !String deriving (Eq) instance Show Type where show ty = case ty of T...
koba-e964/hayashii-mcc
Type.hs
bsd-3-clause
902
0
13
260
351
180
171
42
1
module Spec.VendorID where data VendorID = VendorID{ viName :: String , viID :: Integer , viComment :: String } deriving(Show)
oldmanmike/vulkan
generate/src/Spec/VendorID.hs
bsd-3-clause
212
0
8
105
40
25
15
5
0
{-# LANGUAGE BangPatterns #-} module Main(main) where import Control.Exception (evaluate) import Control.Monad.ST (runST, ST) import Data.Bits (shiftR) import Data.ByteString (ByteString, pack, unpack) import Data.Ix (range) import Data.List (foldl1') import Data.Word (Word8) import System.Environment (getArgs) impor...
ekmett/bitwise
extra/benchmark.hs
bsd-3-clause
7,184
0
14
1,971
3,197
1,714
1,483
182
2
module Language.Interpreter.StdLib.Materials ( addMaterialStdLib ) where import Control.Monad.Except import Gfx.Context ( setMaterial , setMaterialVar ) import Language....
rumblesan/improviz
src/Language/Interpreter/StdLib/Materials.hs
bsd-3-clause
1,379
0
13
507
289
154
135
25
4
-- http://graphics.cs.brown.edu/games/quake/quake3.html#RenderPatch module Q3Demo.Graphics.Q3Patch where import Control.Monad import Data.Vector (Vector,(!)) import qualified Data.Vector as V import qualified Data.Vector.Mutable as MV import Data.Vect.Float hiding (Vector) import Data.Vect.Float.Instances import Q3D...
csabahruska/q3demo
src/Q3Demo/Graphics/Q3Patch.hs
bsd-3-clause
2,240
0
19
673
839
447
392
27
1
{-# LANGUAGE DeriveDataTypeable #-} -- | Provides a data type describing the parsing errors that are possible, though unlikely, -- to be encountered. -- -- Note that since network requests are handled by the @http-conduit@ package, -- the corresponding 'HttpException' is also one a user may wish to handle. -- --...
BlackBrane/quantum-random-numbers
src-lib/Quantum/Random/Exceptions.hs
mit
1,407
0
10
280
210
116
94
18
2
{-# LANGUAGE OverloadedStrings #-} {-| Tests for error handling. -} module Foreign.Lua.Core.ErrorTests (tests) where import Control.Applicative ((<|>), empty) import Data.Either (isLeft) import Foreign.Lua (Lua) import Test.HsLua.Util ( (=:), shouldBeResultOf, shouldHoldForResultOf) import Test.Tasty (TestTree, testGr...
osa1/hslua
test/Foreign/Lua/Core/ErrorTests.hs
mit
824
0
11
122
197
118
79
16
1
-- Copyright (c) 2010, Diego Souza -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditio...
dgvncsz0f/iyql
src/main/haskell/Yql/Core/LocalFunctions/Tree.hs
gpl-3.0
4,180
0
13
1,151
799
430
369
50
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-ecs/gen/Network/AWS/ECS/SubmitContainerStateChange.hs
mpl-2.0
6,406
0
10
1,358
888
530
358
95
1
{-# LANGUAGE OverloadedStrings #-} module HomeTest ( homeSpecs ) where import Yesod.Test homeSpecs :: Specs homeSpecs = describe "These are some example tests" $ it "loads the index and checks it looks right" $ do get_ "/" statusIs 200 htmlAllContain "h1" "Hello" post "/" $ do ...
danse/haskellers
tests/HomeTest.hs
bsd-2-clause
624
0
11
166
121
53
68
19
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAG...
music-suite/music-score
src/Music/Score/Meta/Clef.hs
bsd-3-clause
2,741
0
10
832
485
288
197
51
1
-- | Exposes things that are considered to be too unstable for inclusion in the exports of "Data.Graph.Wrapper". -- -- Use of this module should be avoided as it will change frequently and changes to this module alone will not necessarily -- follow the Package Versioning Policy. {-# OPTIONS_HADDOCK not-home #-} module ...
sashabu/libcspm
src/Data/Graph/Wrapper/Internal.hs
bsd-3-clause
3,532
0
14
774
1,132
586
546
50
3
import Test.Hspec -- import Data.List -- import Data.Ord -- (#) :: Int -> Int -> Fractional a -- x#2=sum[1..x] x#1=foldr(*)1[1..x] x#2=foldr(+)0[1..x] x#3=foldr(-)0[1..x] 0#4=0 x#4=foldr(/)1[1..x] -- START COUNTING 0!3=0 x!y=foldr([(*),(+),(-),(/)]!!y)([1,0,0,1]!!y)[1..x] f s|[(n,b)]<-lex s=read n!(length b-1) -- END...
wolfascu/codegolf
137322-additional-facts/137322-additional-facts_golfed.hs
mit
1,829
1
16
491
999
509
490
60
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} -- Module : Network.AWS.S3.Waiters -- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A co...
romanb/amazonka
amazonka-s3/gen/Network/AWS/S3/Waiters.hs
mpl-2.0
1,778
0
8
487
252
158
94
37
1
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE RankNTypes #-} {-# OPTIONS_HADDOCK hide #-} -- | Extra utils for cloud haskell module DNA.CH where import Control.Concurrent.STM (STM) import Control.Distributed.Process import Control.Distributed.Process.Serializable ----------------------------...
SKA-ScienceDataProcessor/RC
MS6/dna/core/DNA/CH.hs
apache-2.0
1,885
0
12
339
448
229
219
31
1
------------------------------------------------------------------------------- -- -- | Break Arrays in the IO monad -- -- Entries in the array are Word sized Conceptually, a zero-indexed IOArray of -- Bools, initially False. They're represented as Words with 0==False, 1==True. -- They're used to determine whether GHC...
nomeata/ghc
compiler/main/BreakArray.hs
bsd-3-clause
3,493
0
20
880
929
466
463
7
1
------------------------------------------------------------------------------- -- | -- Module : System.Hardware.Haskino.SamplePrograms.Blink -- Based on System.Hardware.Arduino.comm -- Copyright : (c) University of Kansas -- System.Hardware.Arduino (c) Levent Erkok -- License ...
ku-fpg/kansas-amber
System/Hardware/Haskino.hs
bsd-3-clause
3,635
0
5
579
644
448
196
42
0
{-| Module : Idris.Reflection Description : Code related to Idris's reflection system. This module contains quoters and unquoters along with some supporting datatypes. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE PatternGuards, CPP #-} {-# OPTIONS_GHC -fwarn-incomplete-patte...
tpsinnem/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
55,283
0
18
17,196
20,700
10,068
10,632
1,052
11
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DataKinds #-} module Main where import SubHask import SubHask.Algebra.Array import SubHask.Algebra.Group import SubHask.Algebra.Container import SubHask.Algebra.Logic import SubHask.Algebra.Metric import SubHask.Algebra.Parallel impo...
abailly/subhask
test/TestSuite.hs
bsd-3-clause
5,631
0
18
1,593
1,292
790
502
81
1
{-# OPTIONS -fno-cse #-} -- -fno-cse is needed for GLOBAL_VAR's to behave properly ----------------------------------------------------------------------------- -- -- Static flags -- -- Static flags can only be set once, on the command-line. Inside GHC, -- each static flag corresponds to a top-level value, usually of...
lukexi/ghc-7.8-arm64
compiler/main/StaticFlags.hs
bsd-3-clause
7,700
0
13
1,739
936
533
403
-1
-1
{-| Logical Volumes data collector. -} {- Copyright (C) 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 copyright notice, this...
onponomarev/ganeti
src/Ganeti/DataCollectors/Lv.hs
bsd-2-clause
7,017
0
19
1,395
1,410
755
655
119
2
module Pat1 where import Control.Parallel.Strategies (rpar, runEval) f = n1_2 + n2_2 + 1 where n1 = f n2 = f (n1_2, n2_2) = runEval (do n1_2 <- rpar n1 n2_2 <- rpar n2 return (n1_2, n2_2)) n1_2 =...
RefactoringTools/HaRe
old/testing/introThreshold/Pat1.hs
bsd-3-clause
323
0
12
165
98
53
45
13
1
{-# LANGUAGE ScopedTypeVariables #-} module Config where import Distribution.Simple import Distribution.Simple.Setup import Distribution.PackageDescription import Distribution.Simple.LocalBuildInfo import System.Exit import System.Process config :: LocalBuildInfo -> IO (Maybe HookedBuildInfo) config bInfo = do ...
wavewave/HROOT-generate
HROOT-generate/template/HROOT/Config.hs
gpl-3.0
3,341
0
23
1,323
827
415
412
72
5
----------------------------------------------------------------------------- -- -- GHCi's :ctags and :etags commands -- -- (c) The GHC Team 2005-2007 -- ----------------------------------------------------------------------------- {-# OPTIONS_GHC -fno-warn-name-shadowing #-} module GhciTags ( createCTagsWithLineNum...
dterei/GhciSafe
src/GhciTags.hs
bsd-3-clause
7,301
0
20
1,612
1,889
952
937
138
6
{-# LANGUAGE ExplicitForAll #-} module ShouldCompile where identity :: forall a. a -> a identity x = x
urbanslug/ghc
testsuite/tests/typecheck/should_compile/tc248.hs
bsd-3-clause
105
0
6
20
27
16
11
4
1
-- Informatics 1 - Functional Programming -- Tutorial 5 -- -- Due: the tutorial of week 7 (30/31 October) import Control.Monad( liftM, liftM2 ) import Data.List( nub ) import Test.QuickCheck( quickCheck, Arbitrary( arbitrary ), oneof, elements, sized ) -- Warmup exe...
MihaiVisu/HaskellStuff
tutorial5 week7/tutorial5.hs
mit
9,681
4
16
2,788
3,678
1,932
1,746
182
4
module Cmm.ASTToCmm where import qualified Data.Map as Map import qualified Data.List as DL import qualified Data.Bool as B import Data.Int import Control.Monad.Trans.State import Control.Monad.Trans.Class (lift) import ...
cirquit/hjc
src/Cmm/ASTToCmm.hs
mit
13,976
0
22
4,035
4,350
2,172
2,178
288
18
module Grammar.Greek.Morph.Paradigm.Ending where import Control.Lens (over, view, _2) import qualified Data.List as List import Data.Maybe import Data.Text (Text) import qualified Data.Text as Text import Grammar.Common import Grammar.Greek.Morph.Phoneme.Round import Grammar.Greek.Morph.Types import Grammar.Greek.Morp...
ancientlanguage/haskell-analysis
greek-morph/src/Grammar/Greek/Morph/Paradigm/Ending.hs
mit
3,079
0
15
626
1,141
607
534
-1
-1
{-| Module: Flaw.Graphics.Program Description: Shader program support. License: MIT -} {-# LANGUAGE TemplateHaskell #-} module Flaw.Graphics.Program ( Program , OfScalarType(..) , OfAttributeType(..) , AttributeFormat(..) , AttributeType(..) , Normalization(..) , Node , cnst , constf, const2f, const...
quyse/flaw
flaw-graphics/Flaw/Graphics/Program.hs
mit
17,705
0
21
3,563
5,963
3,100
2,863
430
2
import Control.Applicative import Control.Monad import Data.List import Text.Printf import GHC.Exts main = do tests <- readLn forM_ [1..tests] $ \caseNum -> do _ <- getLine x <- map read . words <$> getLine y <- map read . words <$> getLine let ans = sum $ zipWith (*) (sortWith Down x) (sor...
marknsikora/codejam
32016/A.hs
mit
380
0
17
93
159
80
79
13
1
-- | Miscellaneous utility and/or tester functions module Nix.Cache.Client.Misc where import Nix.Cache.Common import Nix.StorePath (NixStoreDir(..), StorePath) import Nix.StorePath (getNixStoreDir, parseStorePath) getNixStorePaths :: Int -> IO [StorePath] getNixStorePaths count = do NixStoreDir d <- getNixStoreDir...
adnelson/nix-binary-cache
src/Nix/Cache/Client/Misc.hs
mit
496
0
14
91
157
81
76
12
2
{-# OPTIONS_GHC -fno-warn-orphans #-} module Graphics.Urho3D.UI.Button( Button , buttonContext , SharedButton , buttonSetPressedOffset , buttonSetPressedChildOffset , buttonSetRepeat , buttonSetRepeatDelay , buttonSetRepeatRate , buttonGetPressedOffset , buttonGetPressedChildOffset , buttonGetRe...
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/UI/Button.hs
mit
5,728
0
16
978
1,259
698
561
-1
-1
-------------------------------------------------- -- | This module is only used in -- | kdtree tests and benchmarks -------------------------------------------------- module Data.KDTree.Internal.LinSearch where import qualified Data.Vector.Generic as V import qualified Data.List as L import qualified D...
fhaust/kdtree
src/Data/KDTree/Internal/LinSearch.hs
mit
1,720
0
11
404
750
388
362
27
2
module Euler.Problem019Test (suite) where import Control.Monad (ap) import Data.Time.Calendar as Cal import Data.Time.Calendar.WeekDate as Week import Test.Tasty (testGroup, TestTree) import Test.Tasty.QuickCheck import Euler.Problem019 suite :: TestTree suite = testGroup "Problem019" [ testProperty "calcula...
whittle/euler
test/Euler/Problem019Test.hs
mit
986
0
9
166
251
139
112
20
1
import Data.Int (Int8) import Data.Text (Text) {- All `size`s indicate width in bits of said field. -} data Register = Register { registerName :: Text , registerSize :: Int8 } deriving (Show) data ControlLine = ControlLine { controlLineName :: Text , controlLineSize :: Int8 } deriving (S...
gxtaillon/lcpu
lasm/lasm.hs
mit
2,137
0
10
452
438
274
164
58
0
{-# htermination (<) :: Ord a => (Maybe a) -> (Maybe a) -> Bool #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_LT_9.hs
mit
68
0
2
15
3
2
1
1
0
{-- Copyright (c) 2014 Gorka Suárez García Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
gorkinovich/Haskell
Problems/Problem0012a.hs
mit
2,377
0
10
519
227
119
108
13
2
#!/usr/bin/env runhaskell import Control.Applicative (liftA, liftA2) import Control.Monad.Trans.State.Lazy import Data.Char (isAlphaNum) import Data.Either.Combinators (mapLeft) import Data.Function (on) import Data.List (group, sort, foldl', intersperse) import Data.Map (Map) import Data.Set (Set) import Data.Tuple (...
larioj/nemo
nemo.hs
mit
6,210
0
17
1,376
2,439
1,274
1,165
175
5
import Control.Monad {- The line: `q <- foldr1 mplus (map return [1..8])` is equivalent to: `q <- [1..8]` for the *List* monad. The first implementation is general to any MonadPlus. That is the generic version has the type signature: queens :: (Eq a, Num a, MonadPlus m) => a -> m [Integer] ... but I think it only wo...
NickAger/LearningHaskell
Monads and all that/N-Queeens.hsproj/Main.hs
mit
1,309
0
11
349
278
142
136
22
1
import System.IO import System.Environment import Data.Char import qualified Data.ByteString.Char8 as B import Data.String.Utils import qualified System.Random as R print_ a = do mapM_ (print) a putStrLn "\n" escape_chars = [("\\n", "\n"), ("\\r", "\r"), ("\\t", "\t")] cycleThrough :: [(String, String)] -> S...
ericvoorhis/glitch-replace
greplace.hs
mit
1,390
0
14
311
491
253
238
34
1
-- Problem 34 -- (0.19 secs, 240,468,232 bytes) import Data.Char (digitToInt) factorial n = product [1..n] curious n = (sum . map factorial . map digitToInt . show $ n) == n -- take 2 found by observation e034 = take 2 . filter curious $ [3..]
synndicate/euler
solutions/e034.hs
gpl-3.0
246
0
11
49
89
46
43
4
1
{-# LANGUAGE QuasiQuotes #-} module Hledger.Cli.Commands.Prices ( pricesmode ,prices ) where import Data.Maybe import Data.List import Data.String.Here import qualified Data.Text as T import Data.Time import Hledger import Hledger.Cli.CliOptions import System.Console.CmdArgs.Explicit pricesmode = hledgerCommandM...
ony/hledger
hledger/Hledger/Cli/Commands/Prices.hs
gpl-3.0
3,060
0
15
739
944
502
442
65
3
{-# LANGUAGE TemplateHaskell #-} module Tetrahedron.NormalConstants where import THUtil import Tetrahedron.NormalDisc import Language.Haskell.TH.Syntax mkConstantDecls allNormalCorners lift mkConstantDecls allNormalArcs lift mkConstantDecls allNormalTris lift
DanielSchuessler/hstri
Tetrahedron/NormalConstants.hs
gpl-3.0
262
0
5
24
46
24
22
8
0
{- - Copyright (C) 2013 Alexander Berntsen <alexander@plaimi.net> - Copyright (C) 2013 Stian Ellingsen <stian@plaimi.net> - - This file is part of bweakfwu. - - bweakfwu 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 Fou...
plaimi/bweakfwu
src/bweakfwu/World.hs
gpl-3.0
16,675
0
14
4,641
4,303
2,397
1,906
239
3
{- Quick & Easy to Learn Experienced programmers in any other language can pick up Python very quickly, and beginners find the clean syntax and indentation structure easy to learn. -} main = do -- Python 3: Simple output (with Unicode) print("Hello, I'm Python5!") -- Hello, I'm Python5! ...
cblp/python5
examples/io.hs
gpl-3.0
481
0
10
124
52
28
24
4
1
module MonadIO where import Control.Monad.IO.Class import Control.Monad.Trans import IdentityT import EitherT import MaybeT import ReaderT import StateT import MonadTrans -- Example MonadIO instances -- 1. IdentityT instance (MonadIO m) => MonadIO (IdentityT m) where liftIO = IdentityT . liftIO -- 2. EitherT ins...
nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles
MonadTransformers/src/MonadIO.hs
gpl-3.0
703
0
7
138
208
119
89
19
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-datastore/gen/Network/Google/Resource/Datastore/Projects/Export.hs
mpl-2.0
6,009
0
17
1,371
797
470
327
114
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/Orders/List.hs
mpl-2.0
6,844
0
19
1,608
935
546
389
127
1
module Data.Order (defaultOrder, parseOrderExpression, Orderable (..)) where import Import import Control.Applicative import Data.Attoparsec.Text as A import Data.Time import qualified Data.Set as S -- import Data.Time data Orderable = Orderable { hasTag :: Text -> Bool , getNamedTs :: Text -> Set UTCTime...
Happy0/snowdrift
Data/Order.hs
agpl-3.0
3,584
0
18
918
1,424
738
686
74
2
-- yammat - Yet Another MateMAT -- Copyright (C) 2015 Amedeo Molnár -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published -- by the Free Software Foundation, either version 3 of the License, or -- (at your option) an...
Mic92/yammat
Handler/Payout.hs
agpl-3.0
1,728
0
16
339
295
155
140
-1
-1
-- eidolon -- A simple gallery in Haskell and Yesod -- Copyright (C) 2015 Amedeo Molnár -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published -- by the Free Software Foundation, either version 3 of the License, or -- ...
Mic92/eidolon
Handler/AdminMediumSettings.hs
agpl-3.0
4,753
0
26
1,303
1,091
515
576
102
4
import System.Plugins import StringProcessorAPI import System.Console.Readline import System.Exit source = "Plugin.hs" stub = "Plugin.stub" symbol = "resource" main = do s <- makeWith source stub [] o <- case s of MakeSuccess _ obj -> do ls <- load obj ["."] [] symbol ...
Changaco/haskell-plugins
testsuite/shell/simple/Main.hs
lgpl-2.1
1,475
0
17
607
466
218
248
35
6
module Minecraft.A328423 (a328423, a328423_list) where import Minecraft.A328422 (a328422_list) a328423 :: Int -> Integer a328423 n = a328423_list !! (n - 1) a328423_list :: [Integer] a328423_list = recurse a328422_list where recurse (a : _ : as) = a : recurse as
peterokagey/haskellOEIS
src/Minecraft/A328423.hs
apache-2.0
267
0
10
44
96
53
43
7
1
import Control.Exception.Base (evaluate) import System.Clock import System.Environment (getArgs) import System.IO -- INPUT IS MANDATORY input :: Int input = 1000 -- SOLUTION GOES HERE solution :: Int -> Int run :: (a -> b) -> a -> Int -> IO () run fun inp iters | iters <= 0 = return () | otherwise = evaluate (fu...
japaric/euler_criterion.rs
templates/template.hs
apache-2.0
908
0
11
213
381
182
199
33
2
{-# LANGUAGE TupleSections, OverloadedStrings #-} module Handler.WSChat where import Import getWSChatR :: Handler RepHtml getWSChatR = do defaultLayout $ do setTitle "WebSocket Chat" addScriptRemote "http://code.jquery.com/jquery-1.6.3.min.js" $(widgetFile "wschat")
notogawa/yesod-websocket-sample
Handler/WSChat.hs
bsd-2-clause
297
0
12
57
52
25
27
9
1
module ExampleCode ( tree ) where import NXT.Core import NXT.Stdlib.Common import NXT.Stdlib.Motor import NXT.Stdlib.Sensor import Prelude hiding ((<), (>), (<=), (>=), (==), (/=), (&&), (||)) black = 45 white = 65 setMotorVal sensorVal = do motorVal <- newVar ifThenElse (sensorVal < black) (motorVal $= ...
agrafix/legoDSL
Examples/ExampleCode.hs
bsd-3-clause
1,239
0
14
424
441
226
215
38
1
{-# LANGUAGE CPP, DeriveDataTypeable, ScopedTypeVariables #-} -- #define TEST module Main where import MFlow.Wai.Blaze.Html.All as MF #ifdef TEST hiding (ask,userWidget) import MFlow.Forms.Test #endif import Data.Typeable import Data.String(fromString) import Data.TCache.DefaultPersistence import Data.TCache.IndexQ...
agocorona/MFlow
Demos/loginUserPage.hs
bsd-3-clause
6,114
0
24
2,092
1,797
904
893
136
9
-- CCS module Main where import Control.Monad import Data.Maybe import Text.Regex.PCRE import Text.Regex.PCRE.ByteString.Lazy import Cache import Dump interestingTypes = "(video|audio)" main = do putStrLn "Loading index table..." cache <- loadIndexTable indexFile putStrLn "Loading cache..." block <- mapM ...
fserb/ccs
ccs.hs
bsd-3-clause
835
0
14
162
219
102
117
26
1
{-# LANGUAGE OverloadedStrings #-} -- | A memcache client suitable for use in LIO. -- -- Here, memcache is treated as a partitioned cache by using the authentication -- feature of a multi-tennant binary memcached cluster. We partition the cache -- based on the current label. module Database.Memcache.LClient ( ...
dterei/memcache-hs
scraps/LClient.hs
bsd-3-clause
1,718
0
11
368
419
220
199
35
1
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TupleSections #-} module Data.Object.Types where import Control.Monad.Reader import Control.Comonad.Cofree import Data.Functor.Foldable (Fix (..), cata) import ...
esmolanka/struct-parse
Data/Object/Types.hs
bsd-3-clause
2,251
0
16
498
874
473
401
58
1
{-# LANGUAGE DeriveDataTypeable #-} -- | -- Module : NXT.Interpretation -- Copyright : Alexander Thiemann <mail@agrafix.net> -- License : BSD3 -- -- Maintainer : Alexander Thiemann <mail@agrafix.net> -- Stability : experimental -- Portability : non-portable (GHC extensions) -- module NXT.Stdlib.Common whe...
agrafix/legoDSL
NXT/StdLib/Common.hs
bsd-3-clause
414
0
9
74
58
36
22
6
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE TypeOperators #-} module Data.Vector.Vinyl.Default.NonEmpty.Tagged.Implication where import Data.Constraint import Data.List.TypeLevel.Constraint (ListAll) import Data.Tuple.TypeLevel ...
andrewthad/vinyl-vectors
src/Data/Vector/Vinyl/Default/NonEmpty/Tagged/Implication.hs
bsd-3-clause
1,594
2
14
505
473
273
200
-1
-1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE...
snapframework/heist
src/Heist/Internal/Types/HeistState.hs
bsd-3-clause
24,294
0
18
5,434
4,142
2,335
1,807
300
2
-- This has functions for setting up and running the IRC client. module Network.Ribot.Irc ( initParts , runConsole , runDaemon ) where import Control.Concurrent import Control.Monad (forever) import Control.Monad.IO.Class (liftIO) import Data.Ribot.Config impor...
erochest/ribot
src/Network/Ribot/Irc.hs
bsd-3-clause
2,502
0
11
767
528
301
227
55
1
{-# LANGUAGE TemplateHaskell #-} module Data.GNG.Data where import Control.Applicative import Control.Lens import Data.Default import Data.Map (Map) import qualified Data.Map as Map data NodeId = NodeId Int deriving (Eq, Ord, Show) data EdgeId = EdgeId Int deriving (Eq, Ord, Show) data Node a = Node { _...
yunomu/gng
Data/GNG/Data.hs
bsd-3-clause
1,273
0
11
326
445
257
188
45
1
{-# LANGUAGE NondecreasingIndentation #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module GhcShake where import GhcPlugins hiding ( varName, errorMsg, fatalErrorMsg ) import GHC ( Ghc, setSessionDynFlags, getSession, GhcMonad(..), guessTarget ) import DriverPipeline ( compileFil...
ezyang/ghc-shake
GhcShake.hs
bsd-3-clause
28,159
32
37
8,580
4,943
2,540
2,403
381
20
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeSynonymInstances #-} module Data.Text.ToTextBuilder where import Data.Text.Lazy.Builder import Data.Text.Lazy.Builder.Int (decimal) import Data.Text.L...
tolysz/rawstring-qm
src/Data/Text/ToTextBuilder.hs
bsd-3-clause
1,171
0
7
268
206
127
79
30
0
module Math.ScytheGraph where import Math.Graphs import Data.List((\\),union) type Vertex a = Marked (Marked a) -- we mark the vertices twice markCrit,unmarkCrit :: Eq a => Graph (Vertex a) -> Vertex a -> Graph (Vertex a) markCrit g v = fmap (\ x -> if x==v then fmap markT x else x) g unmarkCrit g v = fmap (\ x ->...
crvs/scythe
src/Math/ScytheGraph.hs
bsd-3-clause
3,797
0
14
971
1,569
809
760
61
2
{-# LANGUAGE ScopedTypeVariables , OverloadedStrings , FlexibleContexts , BangPatterns #-} module Main where import Main.Options import Imports hiding ((</>)) import Application import Options.Applicative import qualified Data.Yaml as Y import qualified Data.Aeson.Types as A import Netwo...
athanclark/nested-routes-website
src/Main.hs
bsd-3-clause
7,465
0
24
2,024
1,903
974
929
176
7
-- |Datatypes for HTML parameterized over an annotation type and a script type. module BrownPLT.Html.Syntax ( -- * HTML Data Structures HtmlId,AttributeValue, Attribute (..), Html (..) -- * The Script class , Script (..) -- * Miscellaneous Functions , attributeValue, attributeUpdate, attributeSet, isAt...
ducis/flapjax-fixed
WebBits-Html-1.0.2/src/BrownPLT/Html/Syntax.hs
bsd-3-clause
3,316
0
10
634
763
423
340
49
3
{-# LANGUAGE OverloadedStrings #-} module Cheapskate.Util ( joinLines , tabFilter , isWhitespace , isEscapable , normalizeReference , Scanner , scanIndentSpace , scanNonindentSpace , scanSpacesToColumn , scanChar , scanBlankline , scanSpaces , scanSpnl , nfb , nfbChar , upToCountChars ...
avh4/elm-format
elm-format-markdown/Cheapskate/Util.hs
bsd-3-clause
3,557
0
16
740
773
430
343
68
3
module Data.IntervalSet where import Data.Interval as I import Control.Applicative import Control.Lens import Data.List data IntervalSet = IntervalSet {-# UNPACK #-} !Interval Tree | Empty data Tree = Node Tree {-# UNPACK #-} !Interval Tree | Leaf deriving Show data TTree = TNode TTree {-# UNPACK #-} !Interval TTree...
ian-mi/interval-set
Data/IntervalSet.hs
bsd-3-clause
7,363
0
13
2,352
3,773
1,894
1,879
-1
-1
module Parse where import Control.Monad type Format = [Token] data Token = Date | Music | Volume | Temperature | Wifi | Load | Battery deriving (Show,Eq) parseWord :: String -> Maybe Token parseWord w | w=="date" || w=="time" = Just Date | w=="music" || w=="song" = Just Music | w=="volume" = Just Vol...
kaashif/hinfo
src/Parse.hs
bsd-3-clause
619
0
10
148
262
130
132
18
2
module Atomo.Parser.Expand (doPragmas, macroExpand, nextPhase) where import Control.Monad.State import Text.Parsec import Atomo.Environment import Atomo.Helpers import Atomo.Method (addMethod, lookupMap) import Atomo.Parser.Base import Atomo.Pattern (match) import Atomo.Types nextPhase :: [Expr] -> Parser [Expr] ne...
Mathnerd314/atomo
src/Atomo/Parser/Expand.hs
bsd-3-clause
5,098
0
19
1,574
1,893
947
946
129
6
{-# LANGUAGE OverloadedStrings #-} module Retcon.Network.Ekg where import Control.Applicative import Control.Concurrent import Control.Monad import Data.Int import Data.Map (Map) import qualified Data.Map as M import Data.Monoid i...
anchor/retcon
lib/Retcon/Network/Ekg.hs
bsd-3-clause
6,160
0
18
1,656
1,499
774
725
112
3
{-# LANGUAGE NoImplicitPrelude #-} module Origin where import Data.Eq(Eq(..)) import Data.Functor ((<$>)) import Data.Function ((.), ($)) import Data.Either (either, Either(..)) import Data.Map.Strict (Map, lookup) import Data.Maybe (Maybe(..)) import Data.Ord(Ord(..)) import Control.Applicative((<*>)) import Control...
EarthCitizen/baskell
src/Origin.hs
bsd-3-clause
377
0
6
41
153
102
51
12
0
{-# LANGUAGE FlexibleContexts #-} module InternetProtocolVersion7 (solve) where import Data.Char (isLower) import Data.List (tails, null) import qualified Data.Set as Set import Text.Parsec.Prim (ParsecT, Stream, parse, many, try, (<|>)) import Text.Parsec.Char (char, lower, satisfy) import Text.Parsec.Combinator (be...
cjlarose/advent-2016
src/InternetProtocolVersion7.hs
bsd-3-clause
2,357
0
17
520
1,022
526
496
58
2
{-| Module : JsonLog Description : Logging to JSON files License: MIT Maintainer: lars.bruenjes@iohk.io Stability: experimental Portability: GHC This module provides types and functions to support logging to JSON files. -} module Pos.Core.JsonLog ( module Pos.Core.JsonLog.CanJsonLog , module P...
input-output-hk/pos-haskell-prototype
core/src/Pos/Core/JsonLog.hs
mit
522
0
5
115
55
40
15
7
0
{-# LANGUAGE TemplateHaskell #-} module Game.Lib.Types.Building where import Game.Lib.Types.Team import Game.Lib.Types.Unit import Control.Lens data Structure = Prison | Factory { _units :: [Maybe Unit] } deriving (Show...
j-rock/strat
src/Game/Lib/Types/Building.hs
mit
527
0
10
202
111
64
47
16
0
-- https://projecteuler.net/problem=1 multipleOf3or5 n = (n `mod` 3 == 0) || (n `mod` 5 == 0) sumOfAllMultiples n = sum (filter multipleOf3or5 [1..n-1]) -- sumOfAllMultiples 1000
nothiphop/project-euler
001/solution.hs
apache-2.0
180
0
9
27
69
38
31
2
1
module Cauterize.Schema (module X) where import Cauterize.Schema.Parser as X import Cauterize.Schema.Types as X
cauterize-tools/cauterize
src/Cauterize/Schema.hs
bsd-3-clause
113
0
4
14
28
20
8
3
0
-- The same as T5611 but with unsafe calls. {-# LANGUAGE CPP,ForeignFunctionInterface #-} import Control.Concurrent import Foreign.C import System.IO #if defined(mingw32_HOST_OS) sleep n = sleepBlock (n*1000) foreign import stdcall unsafe "Sleep" sleepBlock :: Int -> IO () #else sleep n = sleepBlock n foreign import...
sdiehl/ghc
testsuite/tests/concurrent/should_run/T5611a.hs
bsd-3-clause
1,008
0
12
242
159
76
83
18
1
module TiFreeNames(module TiFreeNames,FreeNames(..)) where import FreeNames import HsIdent import Data.Maybe(mapMaybe) freeTypeNames x = mapMaybe freeTypeName . freeNames $ x freeValueNames x = mapMaybe freeValueName . freeNames $ x freeVars x = filter isHsVar . freeValueNames $ x freeTyvars x = filter isHsVar . free...
kmate/HaRe
old/tools/base/TI/TiFreeNames.hs
bsd-3-clause
610
2
8
90
185
102
83
13
1
{-# LANGUAGE TypeFamilies, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-} {-# LANGUAGE KindSignatures #-} {-# OPTIONS_GHC -fno-warn-redundant-constraints -fno-warn-missing-methods #-} module T10753 where import Data.Kind (Type) class MonadState s m | m -> s where get :: m s newtype StateT s m...
sdiehl/ghc
testsuite/tests/indexed-types/should_compile/T10753.hs
bsd-3-clause
718
0
9
141
251
137
114
-1
-1
{-# LANGUAGE TypeFamilies, GADTs #-} module T8368a where data family Fam a b data instance Fam Int b where MkFam :: Fam Bool b
urbanslug/ghc
testsuite/tests/indexed-types/should_fail/T8368a.hs
bsd-3-clause
133
0
6
30
32
20
12
5
0
module Lisp.TestStdLib where import Debug.Trace(trace) import Test.Helpers import Test.HUnit import Lisp.StdLib import Lisp.Runtime import Data.SyntaxIR evalute = reduce stdLib . Compound testAddition = TestCase $ do assertEqual "(= (+ 2 2) 4)" (Num 4) result1 assertEqual "(= (+ 2 2 2) 6)" (Num 6) result...
AKST/lisp.hs
test/Lisp/TestStdLib.hs
mit
3,267
0
12
825
1,240
603
637
79
1
module AI.Funn.Common where import qualified Data.Vector.Generic as V import qualified Data.Vector.Storable as S isBad :: (RealFloat a) => a -> Bool isBad x = isNaN x || isInfinite x class CheckNAN a where check :: (Show b) => String -> a -> b -> () instance (S.Storable a, RealFloat a) => CheckNAN (S.Vector a) wh...
nshepperd/funn
AI/Funn/Common.hs
mit
1,190
0
11
275
406
218
188
23
1
module PPL2.CodeGen.Main where import PPL2.Prelude import PPL2.VM.Types import PPL2.CodeGen.UntypedExpr (UntypedExpr) import PPL2.CodeGen.Monad (GCError(..)) import PPL2.CodeGen.GenCode (genACode) import PPL2.Pretty.UntypedExpr (prettyUntypedExpr) import PPL2.System.Types -- -------------------------------...
UweSchmidt/ppl2
src/PPL2/CodeGen/Main.hs
mit
774
0
12
166
223
125
98
18
1
module Utilities (blank64BitBlock, fixLittleEndian, testBitAt, setBitAt, permute, listPermute, printError, printErrors, randomRIOs) where --import qualified Data.ByteString as BL import Data.Word(Word8) import Data.Bits(Bits, testBit, setBit, bitSizeMaybe) import Data.Maybe(fromJust) import System.IO(hPutStrLn, stderr...
tombusby/haskell-des
global/Utilities.hs
mit
1,743
2
11
354
753
405
348
41
2
{-# LANGUAGE NoMonomorphismRestriction #-} module Plugins.Gallery.Gallery.Manual41 where import Diagrams.Prelude pts = map p2 [(0,0), (2,3), (5,-2), (-4,1), (0,3)] dot = circle 0.2 # fc blue # lw 0 mkPath closed = position (zip pts (repeat dot)) <> cubicSpline closed pts # lw 0.05 example = mkP...
andrey013/pluginstest
Plugins/Gallery/Gallery/Manual41.hs
mit
359
0
11
78
158
86
72
8
1
import Noise main = do -- Define grid dimensions let w = 256 :: Int h = 256 :: Int let wf = fromIntegral w hf = fromIntegral h let scale = 20.0 -- Print PGM header info putStrLn "P2" putStrLn $ show w ++ " " ++ show h ++ " 256" -- Get list of pixel coords (zero-based...
fmenozzi/functional-programming
main.hs
mit
778
0
16
224
304
157
147
14
1
module Text.Blaze.Html.Renderer.GHCJS ( renderHtml ) where import Text.Blaze.Html (Html) import Text.Blaze.Renderer.GHCJS (renderMarkup) import GHCJS.DOM.Types renderHtml :: IsDocument doc => doc -> Html -> IO [Node] renderHtml = renderMarkup
lethalman/blaze-ghcjs
Text/Blaze/Html/Renderer/GHCJS.hs
mit
253
0
9
38
74
45
29
7
1
{-# LANGUAGE CPP, NoImplicitPrelude #-} module Data.Proxy.Compat ( #if MIN_VERSION_base(4,7,0) module Base, #endif asProxyTypeOf ) where #if MIN_VERSION_base(4,7,0) # if MIN_VERSION_base(4,10,0) import Data.Proxy as Base # else import Data.Proxy as Base hiding (asProxyTypeOf) # endif #endif #if !(MIN_VERSION_base...
haskell-compat/base-compat
base-compat/src/Data/Proxy/Compat.hs
mit
678
0
7
106
80
56
24
7
1
module CompUtils where import Data.Coerce (.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d (f .: g) x y = f (g x y) infixr 9 #. (#.) :: Coercible b c => (b -> c) -> (a -> b) -> a -> c (#.) _ = coerce infixr 9 .# (.#) :: Coercible a b => (b -> c) -> (a -> b) -> a -> c (.#) f _ = coerce f infixl 4 <#$> (<#$>) :: Coe...
oisdk/semiring-num
test/CompUtils.hs
mit
482
0
12
140
325
178
147
17
1
-- | -- Module: Math.NumberTheory.Utils -- Copyright: (c) 2011 Daniel Fischer -- Licence: MIT -- Maintainer: Daniel Fischer <daniel.is.fischer@googlemail.com> -- -- Some utilities, mostly for bit twiddling. -- {-# LANGUAGE BangPatterns #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} {...
Bodigrim/arithmoi
Math/NumberTheory/Utils.hs
mit
7,970
0
13
1,973
2,071
1,133
938
143
4
module WhenView.Stage1.Serializer (calTokens) where import WhenView.Data import Data.Hourglass (Date, TimeOfDay) import qualified Data.Hourglass as H oneDay = H.Period 0 0 1 allDaysFrom day = day:(allDaysFrom $ day `H.dateAddPeriod` oneDay) calTokens :: [Entry] -> [Token] calTokens (e:es) = let d = (date $ ...
zenhack/whenview
src/WhenView/Stage1/Serializer.hs
mit
1,449
0
19
386
590
310
280
35
3
-- | FRP utilities for the IRC library. module ChatCore.IRC.FRP where import Control.Applicative import Control.Lens import qualified Data.Text as T import FRP.Sodium import ChatCore.IRC import ChatCore.Types -- | Filters the given filterCmd :: Event IRCLine -> IRCCommand -> Event IRCLine filterCmd eLine cmd = filt...
Forkk/ChatCore
ChatCore/IRC/FRP.hs
mit
1,093
0
11
211
272
142
130
21
2
-- The code is mostly ripped from -- https://github.com/ekmett/lens/blob/d1d97469f0e93c1d3535308954a060e8a04e37aa/tests/doctests.hsc import Prelude import Control.Applicative import Control.Monad import Data.List import System.Directory import System.FilePath import Test.DocTest import Build_doctests (deps) main :: IO...
nikita-volkov/bit-array
executables/Doctests.hs
mit
2,023
0
12
503
385
220
165
61
1
{-| A simple module defining the types used for the intermediate representation of probes, that is finite automata. Here we define the type-classes for states and labels. -} module Language.Pepa.Probes.StateMachines.NfaTypes ( Move ( .. ) , Nfa ( .. ) , NfaState ( .. ) , NfaLabel ( .. ) ...
allanderek/ipclib
Language/Pepa/Probes/StateMachines/NfaTypes.hs
gpl-2.0
2,451
0
10
607
586
323
263
52
1