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 OverloadedStrings #-} module KafkaSpec (spec) where import Control.Applicative ((<$>)) import Control.Concurrent (threadDelay) import Control.Monad (replicateM) import Data.IORef (modifyIORef', newIORef, readIORef) import Test.Hspec import Test.Hspec.QuickCheck (prop) import Test.Q...
abhinav/kafka-client
integration-test/KafkaSpec.hs
mit
4,695
0
20
1,329
1,315
644
671
92
4
{-# LANGUAGE ScopedTypeVariables, TypeOperators, KindSignatures #-} {-# LANGUAGE TypeFamilies, FlexibleInstances, MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts, UndecidableInstances #-} -- | Utilities for creating selectors for non-record types. -- In general, you should really use record types for your tab...
valderman/selda
selda/src/Database/Selda/MakeSelectors.hs
mit
3,266
0
12
786
948
515
433
54
1
module YNABFormat where import DNBFormat import Types import Data.List (intercalate) import Data.Time.Format (defaultTimeLocale, formatTime) data YNABFormat = YNABFormat TrxDate Payee Category Explanation Outflow Inflow instance Show YNABFormat where show (YNABFormat trxDate payee cat exp outFlow inF...
lstor/traxform
src/YNABFormat.hs
mit
773
0
9
184
194
106
88
17
1
import Data.List (nub) -- The oddly named *nub* returns the distinct elements of a list solution = length $ nub terms where terms = [a ** b | a <- [2..100], b <- [2..100]] main = print solution
drcabana/euler-fp
source/hs/P29.hs
epl-1.0
236
0
8
80
73
39
34
6
1
-- Copyright (c) 2011, bkil.hu -- This program is free software and can be distributed under the terms of -- the GNU General Public License v2, -- see COPYING for detailed licensing terms. -- created on 2010-07-10 19:58 -- http://www.metnet.hu/?m=fc_race&sub=results -- I wanted to know who is the most dependable foreca...
google-code/bkil-open
volatile/calc/maxmin.hs
gpl-2.0
1,034
0
15
215
346
185
161
25
2
{- | Module : $Header$ Description : ShATermConvertible instances Copyright : (c) Christian Maeder, Uni Bremen 2006 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : non-portable (imports programatica modules) 'ShATermConvertibl...
nevrenato/Hets_Fork
Haskell/TiDecorateATC.der.hs
gpl-2.0
845
0
4
139
47
33
14
6
0
module Main where import Control.Applicative import Control.Exception (IOException, catch) import Control.Monad import Data.Char (ord) import Data.Picture import qualified Data.PNM as PNM import Prelude hiding (catch) import...
bfraikin/netpbm
src/Main.hs
gpl-2.0
1,570
0
17
537
464
239
225
44
2
module Main where import qualified Data.Map as Map import Data.Map (Map) import Data.Time.Clock import Data.Time.Format import qualified Data.ByteString.Char8 as BS -- for strict readFile :( import Control.Monad import System.Environment import System.Directory import System.Locale (defaultTimeLocale) import System.Fi...
dvolk/hsactivity
src/Main.hs
gpl-3.0
3,376
0
27
877
1,226
614
612
87
5
-------------------------------------------------------------------------------- -- This file is part of diplomarbeit ("Diplomarbeit Johannes Weiß"). -- -- -- -- diplomarbeit is free software: you can redistribute it and/or modify ...
weissi/diplomarbeit
programs/AllInOne.hs
gpl-3.0
3,357
0
15
1,214
525
285
240
47
4
{-# LANGUAGE InstanceSigs #-} module MaybeT where newtype MaybeT m a = MaybeT { runMaybeT :: m (Maybe a) } instance (Functor m) => Functor (MaybeT m) where fmap f (MaybeT mma) = MaybeT $ (fmap.fmap) f mma instance (Applicative m) => Applicative (MaybeT m) where pure a = MaybeT $ pure (Just a) (Mayb...
nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles
MonadTransformers/src/MaybeT.hs
gpl-3.0
662
0
14
200
290
149
141
18
0
{-# LANGUAGE FlexibleContexts, GADTs, TypeOperators, DataKinds, FlexibleInstances, KindSignatures, ScopedTypeVariables #-} module Main where import Servant.Swagger.Test import Test.Hspec import Modernator.API import Modernator.WebsocketsAPI import Test.QuickCheck.Instances() import Modernator.RequestBodies() import Mo...
mojotech/modernator-haskell
src/Spec.hs
gpl-3.0
1,348
0
9
172
247
129
118
24
1
module Main where import Language.Atom import Language.Atom.Unit import GHC.Word main :: IO () main = do (sched, _, _, _, _) <- compile "atom_example" atomCfg example putStrLn $ reportSchedule sched atomCfg :: Config atomCfg = defaults { cFuncName = "atom_tick" , cStateName = "state_example...
UBMLtonGroup/survey_sonar
Sensor/sensor.hs
gpl-3.0
3,483
0
16
1,198
795
399
396
95
1
import Test.QuickCheck import Control.Monad import Data.Maybe(fromJust) import Data.Word import Dep.Algorithms() import Dep.Algorithms.Sim(emptyCircuit,Circuit,wires,CircuitBuilder,resultingCircuit,addWire,addWires,addNamedWire,Wire(..),makeNandGate,makeNotGate,makeAndGate,sensList,validName,makeClock0,generateDefau...
KommuSoft/dep-software
Test.Dep.Algorithms.Sim.hs
gpl-3.0
3,343
7
15
813
1,244
610
634
100
1
{- Copyright (c) 2014-2015, 2017 Chan Beom Park <cbpark@gmail.com> This file is part of hs-mt2calculator, which is released under the GNU General Public License. See file LICENSE in the top directory of this project or go to <http://www.gnu.org/licenses/> for full license details. -} module Main where impor...
cbpark/hs-mt2calculator
test/test_mt2.hs
gpl-3.0
894
0
12
176
179
94
85
14
1
import qualified Database.QUDB as QUDB import System.Environment import System.Directory import System.IO import Data.Maybe (isJust) import Control.Monad (when) import qualified Control.Exception as E import qualified Data.ByteString.Char8 as C (hGetContents, writeFile) main :: IO () main = do args <- getArgs if l...
jstepien/qudb
qudb/qudb.hs
lgpl-3.0
2,403
7
18
750
848
412
436
75
4
module Main where import Data import Evaluator import PrettyPrinter import FromTree import ToTree main = do let e1 = Lit 2 let e2 = Lit 3 let e3 = Add e1 e2 let e4 = fromTree $ toTree e3 prettyPrint e4; putStr "\n"; prettyPrint e3; putStr...
egaburov/funstuff
Haskell/tytag/xproblem_src/samples/expressions/Haskell/ClosedDatatype/Main.hs
apache-2.0
390
0
11
159
128
61
67
17
1
module Database.Neo4j.Internal.PGM ( Id(..), Label(..), RelationshipType(..), Properties, Node(..), Relationship(..), Entity(..), Direction(..), Segment(..), segmentRelationship, Step, (<-|), (|--), (--|), (|->), Path, singleNodePath, (<@>), (<+>), pathLength, pathNodes, path...
boggle/neo4j-haskell-driver
src/Database/Neo4j/Internal/PGM.hs
apache-2.0
14,124
0
17
3,317
4,495
2,361
2,134
-1
-1
import Data.Char main = do c <- getContents let i' = map (map digitToInt) $ lines c i = takeWhile (/= [0]) i' o = map sum i mapM_ print o
a143753/AOJ
ITP1_8_B.hs
apache-2.0
159
0
13
52
78
38
40
7
1
module Main where import qualified LMemLoopbackService_Client as Client import LMemLoopback_Types import Thrift import Thrift.Protocol.Binary import Thrift.Server import Thrift.Transport import Thrift.Transport.Handle import Control.Exception import Data.Either import Data.Int import Data.List import Data.Maybe impo...
maxeler/maxskins
examples/LMemLoopback/client/hs/Dynamic/LMemLoopbackClient.hs
bsd-2-clause
12,377
6
17
2,859
4,314
2,076
2,238
228
32
module DivisionIntegralFixed where data QuotRem a = Result a | DivisionByZero deriving (Show) fromResult :: QuotRem a -> a fromResult (Result a) = a div' :: (Integral a) => a -> a -> QuotRem (a, a) div' n 0 = DivisionByZero div' n d = div'' n d 0 where div'' n' d' count | abs(n') < abs(d') = Result ((s n...
OCExercise/haskellbook-solutions
chapters/chapter08/exercises/division-integral-fixed.hs
bsd-2-clause
545
0
13
176
285
147
138
14
2
module Obsidian.GCDObsidian.CodeGen.SyncAnalysis (syncAnalysis) where import Obsidian.GCDObsidian.Kernel import Obsidian.GCDObsidian.Program import Obsidian.GCDObsidian.Exp import Obsidian.GCDObsidian.Globs import Data.Word import Data.List import qualified Data.Map as Map {- SyncAnalysis. Try to decide...
svenssonjoel/GCDObsidian
Obsidian/GCDObsidian/CodeGen/SyncAnalysis.hs
bsd-3-clause
6,323
0
15
1,808
719
399
320
39
4
{-| Module : Idris.ErrReverse Description : Utility to make errors readable using transformations. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE PatternGuards #-} module Idris.ErrReverse(errReverse) where import Idris.AbsSyntax import Idris.Core.Evaluate (unfold) import Idri...
uuhan/Idris-dev
src/Idris/ErrReverse.hs
bsd-3-clause
2,734
0
15
1,101
902
452
450
46
12
module Main where import Control.Monad import qualified Data.Text as T import qualified Data.Text.IO as TIO import qualified System.IO as SIO import qualified Data.Text.Lazy as TL import qualified Data.Text.Lazy.IO as TLIO dictWords :: IO String dictWords = SIO.readFile "/usr/share/dict/words" dictWordsT :: IO T.T...
dmvianna/strict
src/text.hs
bsd-3-clause
613
0
10
89
175
100
75
18
1
{-# LANGUAGE DeriveDataTypeable, ScopedTypeVariables #-} import Text.CSL hiding (Citation, Cite(..)) import Text.CSL.Pandoc import System.Environment import Text.JSON import Text.JSON.Generic import Text.JSON.Types (get_field) import Text.Pandoc.Definition hiding (Cite) import qualified Text.Pandoc.Definition as PDD (I...
wyleyr/org-citeproc
org-citeproc.hs
bsd-3-clause
15,402
29
22
5,406
3,284
1,768
1,516
274
7
module Main where import Libs main = readArgs
mike-k-houghton/Builder
src/Main.hs
bsd-3-clause
48
0
4
10
12
8
4
3
1
-- -- Copyright (c) 2009-2011, ERICSSON AB -- 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...
emwap/feldspar-compiler
src/Feldspar/Compiler/Frontend/CommandLine/API/Constants.hs
bsd-3-clause
1,854
0
5
326
73
57
16
7
1
{-# LANGUAGE BangPatterns, MultiParamTypeClasses #-} {-# OPTIONS -fno-warn-orphans #-} module Data.Digest.JH384 ( jh384, JH384Digest(..), JHContext (..), Hash(..), hash, hash', printAsHex, printAsHex' ) where import q...
hakoja/SHA3
Data/Digest/JH384.hs
bsd-3-clause
1,729
0
8
394
361
198
163
42
1
{-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} module Network.SSH.Messages where import Network.SSH.Protocol import Control.Monad ( when ) import Data.ByteString.Short (ShortByteString) import qualified Data.ByteString.Char8 as S import ...
glguy/ssh-hans
src/Network/SSH/Messages.hs
bsd-3-clause
38,360
0
20
11,136
7,664
3,656
4,008
1,022
30
-- Copyright (c) 2016 Eric McCorkle. 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 list of conditi...
emc2/chill
src/IR/FlatIR/LLVMGen/Types.hs
bsd-3-clause
6,777
3
18
1,679
1,488
807
681
97
5
module Main where import Control.Monad.Trans import System.Console.Haskeline import Check import Eval import Parser import Pretty import Syntax main :: IO () main = runInputT defaultSettings loop where loop = do minput <- getInputLine "Untyped> " case minput of Nothing -> outputStrLn "Goodbye." ...
zanesterling/haskell-compiler
src/Main.hs
bsd-3-clause
836
0
16
244
287
143
144
28
3
{-# LANGUAGE FlexibleInstances #-} module Text.CSS.ArbitraryCSS where import Test.QuickCheck import Test.QuickCheck.Gen import Test.Framework.Providers.QuickCheck2 (testProperty) import Data.List (intersperse) import Text.Regex import Text.Regex.Posix data CSSString a = CSSString a String data NewLine = NewLine -- |...
brentonashworth/css-parser
test/Text/CSS/ArbitraryCSS.hs
bsd-3-clause
4,289
0
17
1,363
1,149
584
565
81
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Web.RTBBidder.Types.Request.Audio (Audio(..)) where import qualified Data.Aeson as AESON import Data.Aeson ((.=), (.:), (.:?), (.!=)) import qualified Data.Text as TX import Web.RTBBidder.Types.Request.Banner (Banner(..)) data Audio = Audio ...
hiratara/hs-rtb-bidder
src/Web/RTBBidder/Types/Request/Audio.hs
bsd-3-clause
2,500
0
12
543
716
393
323
71
0
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. {-# LANGUAGE GADT...
rfranek/duckling
Duckling/Temperature/FR/Rules.hs
bsd-3-clause
2,393
0
18
528
542
306
236
60
3
module Lib ( module Client , module Server ) where import Client import Server
stormont/async-examples
ping-pong/src/Lib.hs
bsd-3-clause
92
0
4
27
20
14
6
5
0
{-# LANGUAGE OverloadedStrings #-} module Main where import Web.Scotty as W import qualified HtmlGen as H import Lucid.Base as L import SqlTable (getRandItem) import qualified SqlTable as S import Control.Monad.IO.Class import Database.SQLite.Simple import Data.Maybe (fromJust) import Network.Wai.Middleware.Static im...
arcticmatt/happy-site
src/Main.hs
bsd-3-clause
857
0
20
166
286
151
135
28
1
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. module Duckling.AmountOfMoney.ZH.Tests ( tests ) where import Data.String import Prelude import Test.Tasty im...
facebookincubator/duckling
tests/Duckling/AmountOfMoney/ZH/Tests.hs
bsd-3-clause
522
0
9
78
79
50
29
11
1
module GUI.ItemEditor where import Bucket.EditItem import Bucket.Types import Control.Monad import Data.IORef import Data.List import Data.Maybe import Graphics.UI.Gtk import GUI.ItemsTreeModel handleEditButtonClicked itemEditor treeView model tagsText titleText currentBucketRef updateItemList = do (treePath, _) ...
rickardlindberg/orgapp
src/GUI/ItemEditor.hs
bsd-3-clause
1,468
0
19
404
376
181
195
36
3
module Data.JSON.Schema ( module Data.JSON.Schema.Generic , module Data.JSON.Schema.Types , Proxy (..) ) where import Data.JSON.Schema.Generic import Data.JSON.Schema.Types import Data.Proxy.Compat
silkapp/json-schema
src/Data/JSON/Schema.hs
bsd-3-clause
207
0
5
28
52
37
15
7
0
module Main where import Prelude hiding (length, concat) import Control.Applicative ((<$>)) import Control.Exception (throwIO) import Data.ByteString (ByteString, length, unpack, pack, concat) import Data.Bits ((.|.)) import Data.Map (fromList, empty) import Data.Char (ord) import System.Linux.Netlink.Internal main...
metachord/netlink-hs
bin/Test.hs
bsd-3-clause
891
0
11
194
301
157
144
26
1
module MutablePairs.Data where import Control.Monad.Trans.State.Lazy import qualified Data.Map as M import Data.Maybe (fromMaybe) type Try = Either String type Environment = M.Map String DenotedValue empty :: Environment empty = M.empty initEnvironment ...
li-zhirui/EoplLangs
src/MutablePairs/Data.hs
bsd-3-clause
5,097
0
13
1,141
1,851
958
893
134
3
{-| Module : Data.Number.MPFR.Conversion Description : wrappers for conversion functions Copyright : (c) Aleš Bizjak License : BSD3 Maintainer : ales.bizjak0@gmail.com Stability : experimental Portability : non-portable Conversion from basic MPFR back to basic Haskel...
ekmett/hmpfr
src/Data/Number/MPFR/Conversion.hs
bsd-3-clause
6,465
0
19
2,916
1,730
879
851
108
8
module Main where import Lib main :: IO () main = someFunc {-99 Haskell Problems-} {-| Get the last element of a list-} myLast :: [a] -> a myLast [x] = x myLast (_:xs) = myLast xs {-| Get the second to last element of a list-} myButtLast :: [a] -> a myButtLast [x, _] = x myButtLast (_:xs) = myButtLast xs {-| Get...
MauriceIsAG/HaskellScratch
.stack-work/intero/intero21978WWS.hs
bsd-3-clause
3,845
0
14
1,191
2,223
1,171
1,052
-1
-1
{-# LANGUAGE OverloadedStrings, Safe #-} module Evalso.Cruncher.Language.Java (java) where import Evalso.Cruncher.Language (Language (..)) java :: Language java = Language { _codeFilename = "EvalSO.java" , _compileCommand = Just ["javac", "EvalSO.java"] , _compileTimeout = Just 10 , _runCommand = ["java", ...
eval-so/cruncher
src/Evalso/Cruncher/Language/Java.hs
bsd-3-clause
428
0
8
77
107
69
38
13
1
----------------------------------------------------------------------------- -- | -- Module : TestSuite.Uninterpreted.Function -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Testsuite for Data.SBV.Examples.Uninterpreted.Function -...
Copilot-Language/sbv-for-copilot
SBVUnitTest/TestSuite/Uninterpreted/Function.hs
bsd-3-clause
687
0
11
102
83
52
31
-1
-1
module Utils () where --import Data.Hashable --(|->) =
etu-fkti5301-bgu/alt-exam_automated_theorem_proving
src/Utils.hs
bsd-3-clause
59
0
3
12
9
7
2
2
0
module KnapsackFraction.Central ( KnapsackFraction , make_fixed , make_quiz ) where import KnapsackFraction.Solve ( packs ) import KnapsackFraction.Param import Challenger.Partial import Inter.Types import Inter.Quiz import Autolib.ToDoc import Autolib.Set import Autolib.FiniteMap import Autolib.Reporter import...
florianpilz/autotool
src/KnapsackFraction/Central.hs
gpl-2.0
3,858
56
17
1,022
1,215
625
590
-1
-1
{-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Main -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- module Main (main)...
olorin/amazonka
amazonka-support/test/Main.hs
mpl-2.0
534
0
8
103
76
47
29
9
1
{-# LANGUAGE CPP, NondecreasingIndentation #-} {-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-} ----------------------------------------------------------------------------- -- -- GHC Driver program -- -- (c) The University of Glasgow 2005 -- -------------------------------------------------------...
ryantm/ghc
ghc/Main.hs
bsd-3-clause
33,055
0
27
9,273
6,767
3,493
3,274
520
14
{- | Module : $Header$ Description : Help functions for all automatic theorem provers. Copyright : (c) Rainer Grabbe License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : needs POSIX Data structures, initialising functions for Prove...
keithodulaigh/Hets
THF/ProverState.hs
gpl-2.0
1,861
0
10
311
317
176
141
26
1
{- (c) The University of Glasgow 2006 (c) The AQUA Project, Glasgow University, 1993-1998 TcRules: Typechecking transformation rules -} {-# LANGUAGE ViewPatterns #-} module TcRules ( tcRules ) where import HsSyn import TcRnMonad import TcSimplify import TcMType import TcType import TcHsType import TcExpr import Tc...
olsner/ghc
compiler/typecheck/TcRules.hs
bsd-3-clause
14,360
2
17
4,451
1,645
850
795
135
3
module Graphics.UI.Gtk.Display.Clone where import Control.Exception as E import Control.Monad import Control.Monad.Trans(liftIO) import Graphics.UI.Gtk import Graphics.UI.Gtk.Gdk.GC import Graphics.UI.Gtk.Gdk.Pixbuf import System.Glib.Types data Clone = Clone Image instance WidgetClass Clone instance ObjectClass Clo...
keera-studios/gtk-helpers
gtk3/src/Graphics/UI/Gtk/Display/Clone.hs
bsd-3-clause
3,081
0
18
642
1,172
585
587
75
1
{-# LANGUAGE ScopedTypeVariables #-} -- | -- Copyright : (c) 2010 Simon Meier -- -- License : BSD3-style (see LICENSE) -- -- Maintainer : Simon Meier <iridcode@gmail.com> -- Stability : experimental -- Portability : GHC -- -- Conversion of 'Float's and 'Double's to 'Word32's and 'Word64's. -- module Data.ByteS...
markflorisson/hpack
testrepo/bytestring-0.10.4.1/Data/ByteString/Builder/Prim/Internal/Floating.hs
bsd-3-clause
1,699
0
13
335
288
152
136
25
1
module Application.Helper.View ( -- To use the built in login: -- module IHP.LoginSupport.Helper.View ) where -- Here you can add functions which are available in all your views -- To use the built in login: -- import IHP.LoginSupport.Helper.View
martin-g/FrameworkBenchmarks
frameworks/Haskell/ihp/src/Application/Helper/View.hs
bsd-3-clause
257
0
3
48
15
12
3
1
0
{-# LANGUAGE ConstraintKinds, MultiParamTypeClasses, UndecidableInstances #-} module TcFail where class cls (A cls) => A cls c where
ezyang/ghc
testsuite/tests/typecheck/should_fail/tcfail216.hs
bsd-3-clause
134
0
8
19
29
15
14
-1
-1
module CIS194 (module X) where import CIS194.Homework01 as X
elasticdog/learnhaskell
src/CIS194.hs
isc
62
0
4
10
17
12
5
2
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} -- | Perform a restricted form of block+register tiling corresponding to -- the following pattern: -- * a redomap is quasi-perfectly nested inside a kernel with at -- least two parallel dimension (the perfectly nested restriction -- is r...
HIPERFIT/futhark
src/Futhark/Optimise/BlkRegTiling.hs
isc
48,569
0
55
17,993
12,017
5,929
6,088
743
8
{-# LANGUAGE BangPatterns #-} module DataStructures (module DataStructures, num) where import Graphics.Rendering.OpenGL as GL import Graphics.UI.GLFW as GLFW import Numeric.Units.Dimensional.Prelude as D import Numeric.Units.Dimensional.NonSI import qualified Prelude import Physics data Keyboard = Keyboard { keya :: ...
Stratege/NBody-Simulation
dataStructures.hs
mit
3,085
5
11
493
1,105
618
487
98
1
-- | Data.TSTP.AtomicWord module. -- Adapted from https://github.com/agomezl/tstp2agda. {-# LANGUAGE UnicodeSyntax #-} module Data.TSTP.AtomicWord ( AtomicWord ( AtomicWord ) ) where ------------------------------------------------------------------------------ import Athena.Utils.PrettyPrint ( Pretty(pretty) )...
jonaprieto/athena
src/Data/TSTP/AtomicWord.hs
mit
654
0
8
88
121
71
50
13
0
--- import Data.STRef --- import Control.Monad.ST.Safe --- import Control.Monad (replicateM_) --main = (putStrLn . show) stResult module HigherRank where --- stResult = runST $ do ref <- newSTRef 0 --- replicateM_ 1000000 $ modifySTRef' ref (+1) --- readSTRef ref --- -...
nlim/haskell-playground
src/HigherRank.hs
mit
609
0
9
159
185
112
73
-1
-1
module Main where import Data.List import System.Environment import System.Directory import Scheme.Printer import Scheme.Parser import Scheme.Evaluator import Scheme.REPL main :: IO () main = do args <- getArgs case args of ["-i"] -> lispRepl emptyEnv False ["-i", "-v"] -> lispRepl emptyEnv True (f...
darthdeus/scheme
Main.hs
mit
985
0
18
253
279
139
140
31
6
{-# LANGUAGE OverloadedLists #-} module Irg.Lab2.Geometry.Shapes where import qualified Irg.Lab2.Geometry.Vector as V import qualified Data.Vector as V2 import Data.Maybe import Debug.Trace type Number = Float myTrace :: Show a => a -> a myTrace x = if False then traceShowId x else x polygonFill :: Polygon -> [(Do...
DominikDitoIvosevic/Uni
IRG/src/Irg/Lab2/Geometry/Shapes.hs
mit
4,980
0
17
1,164
1,804
939
865
99
2
{-# LANGUAGE FlexibleInstances, IncoherentInstances #-} ------------------------------------------------------------------------------ module Snap.Snaplet.Rest.Resource.Internal ( Resource (..) , resource , complete , PutAction (..) ) where ---------------------------------------------------------...
zmthy/snaplet-rest
src/Snap/Snaplet/Rest/Resource/Internal.hs
mit
3,369
0
15
726
798
444
354
-1
-1
msum :: Integer -> Integer msum 0 = 0 msum n = n + (msum (n-1)) main = print (msum 500)
lucas8/MPSI
ipt/recursive/misc/sum.hs
mit
91
0
9
24
57
29
28
4
1
module Lib where import Data.List (intercalate) -- from Chapter 8 digitToWord :: Int -> String digitToWord 0 = "zero" digitToWord 1 = "one" digitToWord 2 = "two" digitToWord 3 = "three" digitToWord 4 = "four" digitToWord 5 = "five" digitToWord 6 = "six" digitToWord 7 = "seven" digitToWord 8 = "eight" digitToWord 9 =...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter14/WordNumber/src/Lib.hs
mit
708
0
11
164
239
122
117
21
1
{-# LANGUAGE RecordWildCards, NamedFieldPuns, GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} module Galua.Micro.Type.Eval ( analyze, analyzeFun, Result(..), GlobalBlockName(..), QualifiedBlockName(..) , valueCasesM ) where import Control.Monad import Data.Map ( Map ) import...
GaloisInc/galua
galua-jit/src/Galua/Micro/Type/Eval.hs
mit
17,324
0
25
7,246
4,723
2,254
2,469
390
54
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances, DeriveFunctor #-} module Utils.Gen where import Control.Applicative import Control.Error import Control.Monad.Identity import Control.Monad.Reader import Control.Monad.State import Control.Monad.Writer newtype GenT m a = ...
jozefg/c_of_scheme
src/Utils/Gen.hs
mit
1,637
0
9
377
652
337
315
46
1
-- | Common handler functions. module Handler.Common where import Data.FileEmbed (embedFile) import Import -- These handlers embed files in the executable at compile time to avoid a -- runtime dependency, and for efficiency. getFaviconR :: Handler TypedContent getFaviconR = return $ TypedContent "image/x-icon" ...
nek0/yocage
Handler/Common.hs
mit
793
0
9
166
209
107
102
-1
-1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE ScopedTypeVariables #-} module PostgREST.Middleware where import Data.Maybe (fromMaybe) import Data.Monoid import Data.Text -- import Data.Pool(withResource, Pool) import qualified Hasql as H import qualified Hasql.Postgres as P import Data.String.Conversions(cs) i...
framp/postgrest
src/PostgREST/Middleware.hs
mit
3,057
0
17
758
899
476
423
73
9
{-# LANGUAGE LambdaCase #-} -- | @biegunka@ tool options module Options ( parseArgs , Command(..) , _Init , _Run , _Json , _Version , _Help , scriptName , defaultBiegunkaDataDirectory ) where import Control.Lens import qualified Data.List as List import Data.Version (showVersion...
biegunka/biegunka
bin/Options.hs
mit
2,574
0
14
590
823
457
366
69
12
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisanalyticsv2-application-inputschema.html module Stratosphere.ResourceProperties.KinesisAnalyticsV2Appl...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/KinesisAnalyticsV2ApplicationInputSchema.hs
mit
3,613
0
13
266
354
207
147
36
1
let bubble [] = []; bubble [x] = [x]; bubble (x:y:xs) = if x > y then y:(bubble (x:xs)) else x:(bubble (y:xs)) let length [] = 0; length (x:xs) = 1 + (length xs) let helper 0 a = a; helper n a = helper (n-1) (bubble a) let sort l = helper (length l) l
mathiasquintero/RandomStuff
Haskell/BubbleSort.hs
mit
252
1
12
56
197
103
94
-1
-1
-- Thinkful - List Drills: Longest word -- https://www.codewars.com/kata/58670300f04e7449290000e5 module Kata (longest) where longest :: [String] -> Int longest = maximum . map length
gafiatulin/codewars
src/7 kyu/LengthOfTheLongest.hs
mit
186
0
6
26
35
21
14
3
1
module Spew where import Data.Array (listArray, Array) import qualified Data.Array as A import System.Random import Control.Monad.State.Lazy import Control.Monad.Writer.Lazy import Control.Applicative import qualified Data.Vector as V import Debug.Trace type PrimFastModel = [(String, FrequencySelector)] type FastMod...
pscollins/cmsc-22311-lab-2
Spew.hs
gpl-2.0
2,515
0
14
565
965
517
448
60
3
-- Joe Jevnik -- 20.12.2013 -- The benchmarking tests for my brainfuck interpreter implementation -- interations. import Criterion.Main import Criterion.Config import qualified UnsafeBrainfuck as UBF (main) import qualified NewArrayTest as NAT (main) import qualified SafeBrainfuck as SBF (main) import qualified ...
llllllllll/brainfuck
prof/src/benchmarking.hs
gpl-2.0
821
0
13
242
220
121
99
15
1
-- | Linear regression models, as discussed in chapter 3 of Bishop. module Algorithms.MachineLearning.LinearRegression ( LinearModel, BayesianVarianceModel, regressLinearModel, regressRegularizedLinearModel, regressBayesianLinearModel, regressEMBayesianLinearModel, regressFullyDeterminedEMBayesi...
batterseapower/machine-learning
Algorithms/MachineLearning/LinearRegression.hs
gpl-2.0
13,104
0
14
2,501
1,799
991
808
-1
-1
module Types.Instances where import Data.Typeable import Types.Database import Types.Entry import Types.Response import Types.User deriving instance Typeable Database deriving instance Typeable UserProfile deriving instance Typeable User deriving instance Typeable Error deriving instance Typeable Entry deriving in...
ktvoelker/todo
src/Types/Instances.hs
gpl-3.0
545
0
5
72
135
71
64
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE ScopedTypeVariables #-} module Data.Partition where import GHC.TypeLits -- import Control.Applicative import Control.Monad....
wavewave/qft
old/lib/Data/Partition.hs
gpl-3.0
3,019
0
22
945
923
488
435
56
3
module Main where import DutyPlanner import Test.HUnit import Data.Time.Calendar persons = ["ashrub","scripter","iph","kaktus"] start = (fromGregorian 2014 06 01) end = (fromGregorian 2014 06 04) days = [start..end] duty = [(fromGregorian 2014 06 01,"ashrub"),(fromGregorian 2014 06 02,"scripter"),(fromGreg...
worldmind/dutyplanner
test/Main.hs
gpl-3.0
608
0
9
85
183
104
79
12
1
import Rsa import System.Environment import System.IO import System.IO.Error import Data.Char import Data.List import Data.List.Split decode :: Int->[Int] decode x | x == 0 = [] | otherwise = (decode (x `quot` 1000)) ++ ((x `mod` 1000) : []) main = do args <- getArgs input <- readFile (head arg...
h3nnn4n/rsa-haskell
decrypt.hs
gpl-3.0
811
0
20
203
391
205
186
23
1
module Development.Hake.Tribial ( ghcMake , updateFile_ ) where import System.IO (openFile, hClose, IOMode(WriteMode), hGetLine, IOMode(ReadMode), withFile) import System.IO.Unsafe (unsafeInterleaveIO) import System.Process (runProcess, waitForProcess) import...
YoshikuniJujo/hake_haskell
Development/Hake/Tribial.hs
gpl-3.0
1,595
0
13
472
499
270
229
34
2
import Criterion.Main import Data.BinTree tree0 :: BinTree Integer tree0 = mkTree [0 .. 1000] tree1 :: BinTree Integer tree1 = mkTree [0 .. 1000000] treeE0 :: BinTreeE Integer treeE0 = mkTreeE [0 .. 1000] treeE1 :: BinTreeE Integer treeE1 = mkTreeE [0 .. 1000000] main :: IO () main = defaultMai...
capitanbatata/sandbox
leaves-of-a-tree/bench/LeavesOfATreeBench.hs
gpl-3.0
1,086
0
11
231
285
147
138
23
1
{-# LANGUAGE DeriveDataTypeable #-} -- | A monkey is a process which randomly makes changes to the store. module Ltc.Monkey ( -- * Basic interface Monkey, start, shutdown, -- * Configuration getDelay, setDelay, getActive, setActive ) where import Control.Concurrent ( forkIO, threa...
scvalex/ltc
src/Ltc/Monkey.hs
gpl-3.0
3,366
0
19
952
858
459
399
-1
-1
module Expr where import Parsing import Helper import Lit -- | These are Expressions used in Command data Expr = Add Expr Expr -- ^ Addition | Sub Expr Expr -- ^ Subtration | Mul Expr Expr -- ^ Multiplication | Div Expr Expr -- ^ Division | Val Lit -- ^ Single n...
MaximKN/Haskell1
src/Expr.hs
gpl-3.0
6,656
2
21
3,490
1,426
682
744
133
4
{-# LANGUAGE FlexibleContexts, ScopedTypeVariables #-} module Abstat.Common.FlatDomainProp where import Test.Hspec import Test.QuickCheck import Abstat.Interface.Poset import Abstat.Common.FlatDomain testFlatDomainProperties :: forall domain . (Eq domain, Show domain) => Gen domain -> Spec testFlatDomai...
fpoli/abstat
src/Abstat/Common/FlatDomainProp.hs
gpl-3.0
1,773
0
16
671
537
266
271
39
1
{-# LANGUAGE RecordWildCards #-} -- | Render a grammar into a String, which may form the nucleus of a Haskell -- module. -- -- Note that the resulting file requires manual additions, such as the module -- name. module BioInf.GrammarProducts.Haskell where import Data.Set (toList) import Data.Function import Control.L...
choener/GrammarProducts
old-BioInf/GrammarProducts/Haskell.hs
gpl-3.0
4,050
0
17
906
1,456
761
695
69
2
module Main where import System.IO import System.Environment import System.Process.Internals import System.Directory import Control.Monad import Control.Exception import Text.Read import Text.Regex import Data.List import qualified System.Process as P import qualified Data.ByteString.Lazy as B import qualified Syste...
hgeg/spawn
Main.hs
gpl-3.0
7,659
0
21
1,883
2,337
1,136
1,201
202
5
{-# LANGUAGE ScopedTypeVariables, NoMonomorphismRestriction, RecordWildCards #-} module Main where import Control.Applicative import Control.Monad import Control.Monad.Error import Control.Monad.Reader import Control.Monad.State import Data.Conduit import...
wavewave/lhc-analysis-collection
exe/2013-08-05-XQLD.hs
gpl-3.0
5,620
0
21
1,669
1,561
923
638
125
2
module CSC322a2tester where import CSC322a2 import CSC322a2TestData testOne q r = queens q == r testAll tests = [(i, testOne q r) | (i, q, r) <- tests] result = testAll tests score = sum [1 | (i, x) <- result, x == True] * 0.2 passed = [i | (i, x) <- result, x == True] failed = [i | (i, x) <- result, x == False] resu...
cwlmyjm/haskell
Learning/400/CSC322a2tester.hs
mpl-2.0
350
0
10
75
185
104
81
10
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-dynamodb/gen/Network/AWS/DynamoDB/BatchGetItem.hs
mpl-2.0
13,049
0
16
2,302
868
570
298
79
1
{-| Module : Main -} module Main where import System.Console.GetOpt import System.Environment import System.Exit import System.Timeout import Control.Monad (unless) import System.IO (hPutStr, stderr) import Parser import Text.Parsec.Error (messageString, errorMessages) import Eval import Ast (pretty) import Tran...
tyoko-dev/rwhile-B-haskell
src/Main.hs
agpl-3.0
3,273
0
21
1,179
1,067
552
515
65
10
module Main where states = [(tennessee, mississippi, alabama, georgia, florida) | tennessee <- ["red", "blue", "green"], mississippi <- ["red", "blue", "green"], alabama <- ["red", "blue", "green"], georgia <- ["red", "blue", "green"], florida <- ["red", "blue", "green"], ...
Olical/langs
haskell/day1/states.hs
unlicense
527
0
8
157
168
96
72
14
1
module ConstantFusion where c' :: a -> Char c' = const 'c' constantFusion :: (b -> c) -> (a -> b) -> a -> c constantFusion c f = c . f c0 :: Char c0 = constantFusion c' (+1) 45 c0' :: Char c0' = c' 45 c1 :: Integer c1 = const 30 . ("foo" ++) $ "bar" c1' :: Integer c1' = const 30 3.4 -- End
haroldcarr/learn-haskell-coq-ml-etc
haskell/book/2019-Program_Design_by_Calculation-Oliveira/2015-05-LambdaConf/ConstantFusion.hs
unlicense
298
0
8
77
141
78
63
13
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE LambdaCase #-} module Main where import Control.Monad import Data.Typeable import Data.Int import Foreign.Ptr import Foreign.Storable import Flow import Flow.Vector import Flow.Halide import System.P...
SKA-ScienceDataProcessor/RC
MS6/programs/dotproduct.hs
apache-2.0
3,991
0
16
794
1,311
646
665
-1
-1
{-# LANGUAGE TransformListComp #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Backends.Html.Decl -- Copyright : (c) Simon Marlow 2003-2006, -- David Waern 2006-2009, -- Mark Lentczner 2010 -- License : B...
mrBliss/haddock
haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
bsd-2-clause
39,096
0
22
10,288
11,648
5,898
5,750
613
9
module Data.Kibr.Grammar where import Preamble import Data.SafeCopy data Grammar = A | BAhE | BAI | BE | BEhO | BEI | BIhE | BIhI | BO | BOI | BU | BY1 | BY2 | CAhA | CAI | CEhE | CEI | CO | COI | CU | CUhE | DAhO | DOhU | DOI | FA | FAhA1 | FAhA2 | FAhA3 | F...
dag/kibr
src/Data/Kibr/Grammar.hs
bsd-2-clause
1,450
0
6
632
520
338
182
-1
-1
{-# LANGUAGE FlexibleContexts #-} -- Ondřej Súkup xmonad config ... -- main import import XMonad -- xmonad hooks import XMonad.Hooks.DynamicLog import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageHelpers import XMonad.Hooks.SetWMName import XMonad.Hooks.UrgencyHook --xmonad action...
mimi1vx/dotfiles
ntb/.xmonad/xmonad.hs
bsd-2-clause
8,572
0
14
1,767
1,504
907
597
152
1
module ImessageSpec (main, spec) where import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do describe "someFunction" $ do it "should work fine" $ do True `shouldBe` False
mitchty/imessage
test/ImessageSpec.hs
bsd-3-clause
205
0
13
49
74
39
35
9
1
module ActiveSync where import qualified Network.HTTP.Conduit as HTTP import qualified Network.HTTP.Types.Status as Status import qualified Network.HTTP.Types.Header as HType import Data.Conduit import Data.ByteString.Char8 ( pack, unpack ) import Control.Applicative import Control.Exception ( try, SomeException ) im...
eazy-f/yahui
src/ActiveSync.hs
bsd-3-clause
7,011
0
22
1,888
1,955
1,027
928
155
5
{-# LANGUAGE TemplateHaskell , RankNTypes , ConstraintKinds , FlexibleInstances #-} -- | This example illustrates the simplest variety of implementing one -- interface in terms of another - renaming a method. module Test where import Classes import Language.Haskell.InstanceTemplates $(instantiate [tem...
mgsloan/instance-templates
tests/simple/Test.hs
bsd-3-clause
410
0
9
88
58
37
21
13
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UnicodeSyntax #-} {-| [@ISO639-1@] bg [@ISO639-2@] bul [@ISO639-3@] bul [@Native name@] български език [@English name@] ...
telser/numerals
src-test/Text/Numeral/Language/BUL/TestData.hs
bsd-3-clause
9,904
0
11
2,189
1,854
1,213
641
198
1