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
-- | Use persistent-mongodb the same way you would use other persistent -- libraries and refer to the general persistent documentation. -- There are some new MongoDB specific filters under the filters section. -- These help extend your query into a nested document. -- -- However, at some point you will find the normal ...
greydot/persistent
persistent-mongoDB/Database/Persist/MongoDB.hs
mit
59,933
197
52
14,541
13,882
7,482
6,400
-1
-1
{-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} module Config.Database where import Control.Monad.Logger import Control.Monad.Trans.Resource import qualified Data.Text as T import Data.Text.Encoding (encodeUtf8) import qualified Database.Persist as...
folsen/haskell-startapp
src/Config/Database.hs
mit
2,040
0
15
455
564
298
266
53
3
module Filter.Multicol (multicol) where import Text.Pandoc.Definition import Text.Pandoc.Walk tex :: String -> Block tex = RawBlock (Format "tex") wrap :: Block -> Block wrap b = Div ("",[],[]) [ tex $ "%--trim--%\n\\end{pppmulticol}" , b , tex $ "\\begin{pppmulticol}\n%--trim--%" ] columnize :: Bool -> Blo...
Thhethssmuz/ppp
src/Filter/Multicol.hs
mit
635
0
12
164
223
119
104
18
2
import BoardTests import PieceTests import GameTests main :: IO () main = do pieceSpec boardSpec gameSpec
nablaa/hquarto
test/Spec.hs
gpl-2.0
127
0
7
37
39
18
21
7
1
{-# LANGUAGE UndecidableInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts #-} module Code.Class where import Code.Type import Code.Param import Inter.Types import Challenger.Partial import Autolib.ToDoc import Autolib.Reader import Autolib.Size import Autolib.Reporter import Data.Typeable inst...
Erdwolf/autotool-bonn
src/Code/Class.hs
gpl-2.0
2,002
17
12
556
748
385
363
50
1
module HEP.Automation.MadGraph.Dataset.Set20110411set3 where import HEP.Storage.WebDAV import HEP.Automation.MadGraph.Model import HEP.Automation.MadGraph.Machine import HEP.Automation.MadGraph.UserCut import HEP.Automation.MadGraph.SetupType import HEP.Automation.MadGraph.Model.ZpHFull import HEP.Automation.MadGra...
wavewave/madgraph-auto-dataset
src/HEP/Automation/MadGraph/Dataset/Set20110411set3.hs
gpl-3.0
1,585
0
8
325
338
201
137
36
1
module FQuoter.Serialize.Serialize ( SerializationF (..) ,SerializationT ,Serialization ,create ,associate ,associate2 ,dissociate ,search ,lastInsert ,update ,delete ,commitAction ,rollbackAction ,process ,readSchema ,buildNewDB ) where import Data.List hiding (delete) import Data.List.Split impor...
Raveline/FQuoter
lib/FQuoter/Serialize/Serialize.hs
gpl-3.0
8,005
0
13
2,602
2,853
1,454
1,399
162
1
module Types where type VarType = String data Lambda = Var VarType | App Lambda Lambda | Abs VarType Lambda deriving Show data Definition = Def { name :: String , expr :: Lambda } deriving Show type Source = [Definition]
xkollar/lambda2js
src/Types.hs
gpl-3.0
255
0
8
75
69
43
26
12
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-iam/gen/Network/AWS/IAM/GenerateCredentialReport.hs
mpl-2.0
4,447
0
13
877
553
332
221
74
1
module HLol.Network.Rest ( get, getWithOpts, sendAPIRequest, sendAPIRequest', sendAPIRequest_, LolRequest, LolError, Region(..) ) where import HLol.Data.Common import HLol.Logging.Logger import HLol.Utils import Control.Monad import Network.Curl import Data.Aeson import Data.List ...
tetigi/hlol
src/HLol/Network/Rest.hs
agpl-3.0
2,691
0
17
712
864
442
422
66
7
module Print3Broken where printSecond :: String -> IO () printSecond greeting = do putStrLn greeting main :: IO () main = do putStrLn greeting printSecond greeting where greeting = "Yarrrrr"
aniketd/learn.haskell
haskellbook/printbroken.hs
unlicense
209
0
7
48
66
32
34
9
1
module Main where main :: IO () main = putStrLn "main"
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/testing/2019-11-oskar-wickstrom-tt-and-fixing-bugs-with-property-based-testing/app/Main.hs
unlicense
57
0
6
13
22
12
10
3
1
module RayCaster.Color where data Color = Color Double Double Double deriving (Eq, Show) red :: Color red = Color 1 0 0 green :: Color green = Color 0 1 0 blue :: Color blue = Color 0 0 1 white :: Color white = Color 1 1 1 black :: Color black = Color 0 0 0 pink :: Color pink = Color 1 0.5 0.5 colorMult :: Doub...
bkach/HaskellRaycaster
src/RayCaster/Color.hs
apache-2.0
731
0
9
165
350
185
165
21
1
module Activate where import GLUTContext import Transform import qualified Display import qualified Input import qualified Idle import qualified Time import Control.Lens import Control.Applicative import Data.IORef import Graphics.UI.GLUT activate :: GLUTContext a -> Transform a -> Display.Displayer a -> IO () act...
epeld/zatacka
old/Activate.hs
apache-2.0
900
0
9
158
312
154
158
-1
-1
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-} module BV ( -- * BV Language Program (..) , Expr (..) , Bin (..) , Op1 (..) , Op2 (..) , ID -- * Semantics , Value , Env , eval -- * Metadata , Measureable (..) , Op (..) , isValidFor -- * Pretty Printing , Render (..) ...
msakai/icfpc2013
src/BV.hs
bsd-2-clause
8,075
0
17
2,160
3,006
1,564
1,442
230
3
module GameState (bestMove, GameState(GameState, token, board)) where import Tree import Board import Token import Minimax import Data.Foldable import Valuable import Prelude bestMove s@(GameState X _) = findMove s findMax minimize bestMove s@(GameState O _) = findMove s findMin maximize data GameState = GameState {...
MichaelBaker/haskell-tictactoe
src/GameState.hs
bsd-2-clause
1,375
0
8
383
473
244
229
34
1
import Data.Array import qualified Data.Map as M import Data.Maybe import System.IO.Unsafe -- SegTree data SegTree a = StLeaf Int a | StNode Int Int a (SegTree a) (SegTree a) deriving (Eq, Ord, Show) buildrmq acc cs lvs x = acc' where updacc (lstseq, lstmap, ix) = (lstseq', lstmap', succ ix) ...
pbl64k/HackerRank-Contests
2014-09-05-FP/ApeWar/aw.pt.hs
bsd-2-clause
5,290
0
16
2,095
2,525
1,364
1,161
122
5
import Data.Array import qualified Data.Array.Unboxed as U import qualified Data.Foldable as Fld import Data.List import qualified Data.Map as Map import Data.Maybe import qualified Data.Sequence as Seq buildArr la a b f = res where res = la (a, b) (map (f (res !)) [a .. b]) merge [] xs = xs merge xs [] =...
pbl64k/HackerRank-Contests
2014-06-20-FP/BoleynSalary/bs.memo.hs
bsd-2-clause
1,820
0
22
475
859
455
404
36
2
{- Copyright (c) 2013, Markus Barenhoff <alios@alios.org> 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 c...
alios/lambda-devs
Data/DEVS.hs
bsd-3-clause
1,672
0
5
297
35
24
11
5
0
module RealWorld.Prelude ( module A , failWith , (??) , failWithM , (!?) ) where import Prelude as A import Control.Applicative as A (Alternative(..), optional) import Control.Monad as A (MonadPlus(..), guard, mfilter, when) import Control.Monad.Catch as A (MonadThrow(..), catch) import Con...
zudov/servant-realworld-example-app
src/RealWorld/Prelude.hs
bsd-3-clause
1,932
0
10
503
680
432
248
45
1
{-# LANGUAGE OverloadedStrings #-} module Text_Align where import Graphics.Blank import Wiki -- (578,200) main :: IO () main = blankCanvas 3000 $ \ context -> do send context $ do let x = width context / 2 let y = height context / 2 font "30pt Calibri" textAlign "center" fi...
ku-fpg/blank-canvas
wiki-suite/Text_Align.hs
bsd-3-clause
453
0
16
128
138
65
73
15
1
module SecondFront.Logging( enableConsoleLogging ) where import System.IO (stderr) -- Logging utilities import System.Log.Formatter (simpleLogFormatter) import System.Log.Handler (setFormatter, LogHandler) import System.Log.Handler.Simple --...
alcidesv/second-front
hs-src/SecondFront/Logging.hs
bsd-3-clause
1,256
0
13
311
202
111
91
20
1
module Main where import Control.Monad import Data.List import System.Environment main = do innm:outnm:_ <- getArgs lns <- lines `fmap` readFile innm writeFile outnm $ unlines $ f lns f (l:ls) | "\\begin{tabbing}" `isPrefixOf` l = f $ onHead (drop (length "\\end{tabbing}")) $ dropWhile...
glutamate/tnutils
StripCode.hs
bsd-3-clause
479
0
12
120
232
120
112
15
1
{-| Copyright : (c) Dave Laing, 2017 License : BSD3 Maintainer : dave.laing.80@gmail.com Stability : experimental Portability : non-portable -} module Fragment.TyAll.Rules.Type.Infer.Common ( ) where
dalaing/type-systems
src/Fragment/TyAll/Rules/Type/Infer/Common.hs
bsd-3-clause
211
0
3
36
14
11
3
1
0
{-# LANGUAGE OverloadedStrings #-} module Http where import Control.Lens import Data.Aeson import Data.Aeson.Lens (_String, key) import qualified Data.ByteString.Lazy as BL import Network.Wreq as WR (get, post, delete, put, customPayloadMethod, responseBody, responseStatus, statusCode, resp...
sphaso/firebase-haskell-client
src/Http.hs
bsd-3-clause
2,953
0
12
1,078
742
378
364
-1
-1
module Interpreter (interpret) where import Prelude hiding (Left, Right) import Tokens (tokenize) import Parser import Control.Monad import Control.Monad.Trans.State.Lazy import Data.Char import Data.List import Data.Maybe import qualified Data.Vector as V import Data.Vector ((!)) import Data.Word import Text.Printf ...
tcsavage/rumex
src/Interpreter.hs
bsd-3-clause
3,423
0
17
712
1,659
876
783
90
8
module Input(InputState, isDown) where import Data.Map(Map) import qualified Data.Map as Map type InputState = Map Char Bool isDown ch m = maybe False id (Map.lookup ch m)
Rotsor/wheeled-vehicle
Input.hs
bsd-3-clause
175
0
8
30
68
39
29
5
1
{-# LANGUAGE DeriveFunctor, RankNTypes, GADTs #-} module BinaryIndexedTree where import Prelude hiding (sum) import Control.Monad (forM_) import Control.Monad.ST import Control.Monad.Primitive (PrimState, PrimMonad) import Data.Bits import Data.Monoid import qualified Data.Vector.Mutable as M import qualified Data.Ve...
cutsea110/aop
src/BinaryIndexedTree.hs
bsd-3-clause
3,497
0
15
988
1,218
642
576
59
2
{-# LANGUAGE OverloadedStrings #-} module Network.Syncthing.Types.DeviceInfo ( DeviceInfo(..) ) where import Control.Applicative ((<$>)) import Control.Monad (MonadPlus (mzero)) import Data.Aeson (FromJSON, Value (..), parseJ...
jetho/syncthing-hs
Network/Syncthing/Types/DeviceInfo.hs
bsd-3-clause
731
0
9
238
167
102
65
14
0
{-# LANGUAGE GADTs, RankNTypes #-} module Options.Applicative.Internal ( P , Context(..) , MonadP(..) , ParseError(..) , uncons , hoistMaybe , hoistEither , runP , Completion , runCompletion , SomeParser(..) , ComplError(..) , ListT , takeListT , runListT , NondetT , cut , (<!>)...
thielema/optparse-applicative
Options/Applicative/Internal.hs
bsd-3-clause
7,210
0
15
1,681
3,033
1,555
1,478
211
3
{-# LANGUAGE OverloadedStrings #-} module Text.Digestive.Heist.Extras ( module E , dfPath , dfInputCheckboxMultiple ) where import Data.Map.Syntax ((##)) import Data.Text (Text) import Text.Digestive.View (View, absoluteRef, fieldInputChoice) import Heist.Interpreted import qualified Text.XmlHtml as X import Te...
cimmanon/digestive-functors-heist-extras
src/Text/Digestive/Heist/Extras.hs
bsd-3-clause
1,923
4
17
263
412
245
167
32
2
module Main where import Svg import Data.Complex import Dft import Data.Foldable import System.Environment import Data.Maybe import Util import qualified Data.Vector as V import Numeric.FFT.Vector.Invertible _N = 256 :: Int _N_Minus1 = _N - 1 :: Int square :: (Enum a, Floating a) => Int -> [a] square n = [sum [sin (...
tilgalas/haskell-fourier
app/Main.hs
bsd-3-clause
5,388
0
62
1,409
2,042
1,058
984
95
1
{-# language CPP #-} -- | = Name -- -- XR_MSFT_hand_tracking_mesh - instance extension -- -- = Specification -- -- See -- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_MSFT_hand_tracking_mesh XR_MSFT_hand_tracking_mesh> -- in the main specification for complete information. -- -- = Registered ...
expipiplus1/vulkan
openxr/src/OpenXR/Extensions/XR_MSFT_hand_tracking_mesh.hs
bsd-3-clause
53,294
1
17
9,471
7,433
4,329
3,104
-1
-1
module TeamSelect ( interactiveTeamSelection ) where import Prelude () import Prelude.MH import Brick import Brick.Widgets.Border import Brick.Widgets.Center import Brick.Widgets.List import qualified Data.Function as F import Data.List ( sortB...
aisamanra/matterhorn
src/TeamSelect.hs
bsd-3-clause
2,010
0
13
545
600
317
283
54
1
{- Testing definitiosn in no-role-annots package. Copyright 2014 Richard Eisenberg https://github.com/goldfirere/no-role-annots/ -} {-# LANGUAGE TemplateHaskell, GADTs #-} {-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-warnings-deprecations #-} module Test.Defns (MyMap1, MyMap2, mkMap2, MyPtr1, MyPtr2, MyMap...
goldfirere/no-role-annots
Test/Defns.hs
bsd-3-clause
875
0
8
141
245
145
100
15
1
{-# LANGUAGE OverloadedStrings #-} module Web.RBB.Crawler.MetaCombinerSpec where import Control.Applicative import Control.Lens hiding (elements) import qualified Data.IxSet as IxSet import Data.Monoid import Data.Set (Se...
saep/repo-based-blog
test-suite/Web/RBB/Crawler/MetaCombinerSpec.hs
bsd-3-clause
6,017
0
22
2,426
1,671
889
782
137
2
{- chris WBL0.hs:37:5: "WBL0.hs" (line 37, column 10): [lq| data Heap a <q :: a -> a -> Prop> = ^ unexpected reserved word "data" expecting variable identifier -} {-# LANGUAGE QuasiQuotes #-} ----------------------------------------------------------------------- -- Weight-Biased Leftist ...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/WBL0.hs
bsd-3-clause
6,935
0
12
1,957
852
498
354
57
2
module Tests.Operations.RunSpec ( spec ) where import Test.Hspec import Test.QuickCheck import Tests.Common (assertFa) import Operations.Regular (charsToSymbols, run) spec :: Spec spec = describe "FA" $ do describe "oneStateFa.txt" $ do it "accepts empty language" $ assertFa "oneStateFa.txt"...
jakubriha/automata
tests/Tests/Operations/RunSpec.hs
bsd-3-clause
720
0
18
177
231
119
112
19
1
main = "hello world"
roberth/uu-helium
test/parser/NewlineInString.hs
gpl-3.0
21
4
5
4
11
6
5
-1
-1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-| Journal entries report, used by the print command. -} module Hledger.Reports.EntriesReport ( EntriesReport, EntriesReportItem, entriesReport, -- * Tests tests_EntriesReport ) where import Dat...
adept/hledger
hledger-lib/Hledger/Reports/EntriesReport.hs
gpl-3.0
1,524
0
20
228
317
177
140
26
1
<?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="bs-BA"> <title>Export Report | ZAP Extension</title> <maps> <homeID>top</homeID> <mapr...
veggiespam/zap-extensions
addOns/exportreport/src/main/javahelp/org/zaproxy/zap/extension/exportreport/resources/help_bs_BA/helpset_bs_BA.hs
apache-2.0
975
80
66
160
415
210
205
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} #if __GLASGOW_HASKELL__ >= 710 {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ViewPatterns #-} #endif ----------------------------------------------------------------------------- -- | -- Module : Data.Text.Strict.Lens -- Copyright : (C) 2012-2015 Edward Km...
omefire/lens
src/Data/Text/Strict/Lens.hs
bsd-3-clause
3,974
0
13
711
558
351
207
50
1
{- (c) The University of Glasgow 2006-2012 (c) The GRASP Project, Glasgow University, 1992-2002 Various types used during typechecking, please see TcRnMonad as well for operations on these types. You probably want to import it, instead of this module. All the monads exported here are built on top of the same IOEnv m...
pparkkin/eta
compiler/ETA/TypeCheck/TcRnTypes.hs
bsd-3-clause
88,586
0
16
26,441
10,603
6,106
4,497
848
2
{- Teak synthesiser for the Balsa language Copyright (C) 2007-2010 The University of Manchester 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 3 of the License, or...
Mahdi89/eTeak
src/SimPN.hs
bsd-3-clause
54,565
0
25
19,937
17,107
8,571
8,536
920
20
module Main where import Test.Framework (Test, defaultMain, testGroup) import Test.Framework.Providers.HUnit (testCase) import Test.Framework.Providers.QuickCheck2 (testProperty) import Test.HUnit ((@=?)) import Test.QuickCheck hiding ((.&.)) import PTS.Syntax.Substitution.Tests import PTS.Syntax.Parser.Tests import ...
Blaisorblade/pts
src-test/tests.hs
bsd-3-clause
780
0
7
98
205
129
76
20
1
module QuadraticInterpolation where import Data.Array.Repa as R import Data.Array.Repa.Unsafe as R import qualified Data.Vector.Unboxed as VU -- Internal Modules import CommonTypes import LinearAlgebra import ReactionCoordinate -- ==================> <================== type DeltaQ = Array U DIM2 Double type G...
felipeZ/Dynamics
src/QuadraticInterpolation.hs
bsd-3-clause
1,789
0
12
378
295
165
130
23
1
-- -- Copyright (c) 2015 Assured Information Security, Inc. <pattersonc@ainfosec.com> -- Copyright (c) 2014 Citrix Systems, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either ver...
eric-ch/manager
upgrade-db/Migrations/M_24.hs
gpl-2.0
1,558
0
16
333
179
107
72
19
2
import System.Plugins import API src = "../Plugin.hs" wrap = "../Wrapper.hs" apipath = "../api" main = do status <- make src ["-i"++apipath] case status of MakeSuccess _ _ -> f MakeFailure e -> mapM_ putStrLn e where f = do v <- pdynload "../Plugin.o" ["../api"] [...
abuiles/turbinado-blog
tmp/dependencies/hs-plugins-1.3.1/testsuite/pdynload/spj3/prog/Main.hs
bsd-3-clause
523
0
16
195
165
81
84
13
3
{-| Module : Unicorn.Hook Description : Unicorn hooks. Copyright : (c) Adrian Herrera, 2016 License : GPL-2 Insert hook points into the Unicorn emulator engine. -} module Unicorn.Hook ( -- * Hook types Hook , MemoryHookType(..) , MemoryEventHookType(..) , MemoryAccess(..) -- * H...
eltongo/unicorn
bindings/haskell/src/Unicorn/Hook.hs
gpl-2.0
9,500
0
14
3,546
1,346
705
641
157
2
{-| Module : Util.Net Description : Utilities for Network IO. License : BSD3 Maintainer : The Idris Community. -} module Util.Net (listenOnLocalhost, listenOnLocalhostAnyPort) where import Control.Exception (bracketOnError) import Network.Socket -- Copied from upstream impl of listenOn -- bound to localhost...
kojiromike/Idris-dev
src/Util/Net.hs
bsd-3-clause
1,325
0
14
326
335
166
169
28
1
{-# OPTIONS_GHC -fwarn-redundant-constraints #-} module T9973 where duplicateDecl :: (Eq t) => t -> IO () -- #9973 was a bogus "redundant constraint" here duplicateDecl sigs = do { newSpan <- return typeSig -- **** commenting out the next three lines causes the original warning to disappear ; let ro...
sdiehl/ghc
testsuite/tests/typecheck/should_compile/T9973.hs
bsd-3-clause
561
0
12
140
127
69
58
11
1
main :: IO () main = main' () where main' _ = main >> main' ()
wxwxwwxxx/ghc
testsuite/tests/rts/T9579/StackOverflow.hs
bsd-3-clause
69
0
9
22
40
19
21
3
1
{-# LANGUAGE DoRec #-} module Main where main = do { x <- foo; print x } foo :: IO Int foo = do rec a1 <- return a2 a2 <- return a3 a3 <- return a4 a4 <- return a5 a5 <- return b1 b1 <- return b2 b2 <- return b3 ...
wxwxwwxxx/ghc
testsuite/tests/deSugar/should_run/T5742.hs
bsd-3-clause
2,578
0
10
1,416
848
345
503
86
1
module ShouldFail where class A a where op1 :: a -> a instance A (a,(b,c)) where op1 a = a
urbanslug/ghc
testsuite/tests/typecheck/should_fail/tcfail047.hs
bsd-3-clause
95
0
7
24
50
28
22
5
0
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Tests.Sodium.Hash.Sha512 where import Tests.Sodium.Hash.Common import Crypto.Sodium.Hash.Sha512 import Test.Tasty import Test.Tasty.HUnit import Test.Ta...
dnaq/crypto-sodium
test/Tests/Sodium/Hash/Sha512.hs
mit
1,557
0
6
483
335
217
118
30
1
import FPPrac import RoseTree data Tree1c = Leaf1c | Node1c Number Tree1c Tree1c pp1c :: Tree1c -> RoseTree pp1c (Node1c i t1 t2) = RoseNode (show i) [(pp1c t1), (pp1c t2)] pp1c Leaf1c = RoseNode "" [] isBalanced :: Tree1c -> Bool isBalanced (Node1c _ t1 t2) = (isBalanced t1) && (isBalanced t2) && abs(depth t1 - dep...
tcoenraad/functioneel-programmeren
practica/serie3/8.balance-tree.hs
mit
1,087
0
15
187
439
230
209
20
1
-- | Types and functions for dealing with the API client itself. module Strive.Client ( Client (..) , buildClient ) where import Data.ByteString.Lazy (ByteString) import Data.Text (Text, unpack) import Network.HTTP.Client.Conduit (newManager) import Network.HTTP.Conduit (Request, Response, httpLbs) -- | Strava ...
bitemyapp/strive
library/Strive/Client.hs
mit
888
0
12
175
207
117
90
21
1
module AI.Funn.CL.DSL.AST where import Data.List.Split import Data.List type Name = String type TypeDecl = String data Expr = ExprLit String | ExprVar Name | ExprIndex Name Expr | ExprCall Name [Expr] | ExprOp Expr Name Expr | ExprCond Expr Expr Expr deriving (Show...
nshepperd/funn
AI/Funn/CL/DSL/AST.hs
mit
2,277
0
16
742
805
410
395
56
1
{-# LANGUAGE NoImplicitPrelude, DataKinds, FlexibleContexts, TypeFamilies, DeriveDataTypeable, TemplateHaskell #-} {-# OPTIONS_GHC -Wall #-} module LLVM.General.Util.Module ( ModuleBuilder(), ModuleAST, moduleFromAST, moduleFromBitcode, moduleFromLLVMAssembly, moduleFromLLVMAssemblyFile, moduleFromBitcode...
dfoxfranke/llvm-general-util
LLVM/General/Util/Module.hs
mit
9,013
0
24
2,330
2,358
1,220
1,138
211
8
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {- | Types used in generating and solving contact constraints. -} module Physics.Constraints.Types where import C...
ublubu/shapes
shapes/src/Physics/Constraints/Types.hs
mit
2,830
0
9
590
361
218
143
59
0
-- | -- Module : Elrond.Core.Types -- Description : -- Copyright : (c) Jonatan H Sundqvist, 2015 -- License : MIT -- Maintainer : Jonatan H Sundqvist -- Stability : experimental|stable -- Portability : POSIX (not sure) -- -- Created December 22 2015 -- TODO | - -- - -- SPEC | - -- - --...
SwiftsNamesake/Elrond
src/Elrond/Core/Types.hs
mit
2,778
14
9
375
232
154
78
20
0
perpPoint (p, q) (a, b, c) = (x, y) where x = (a * c + b * d) / (a * a + b * b) y = (b * c - a * d) / (a * a + b * b) d = b * p - a * q main = do print $ perpPoint (0, 2) (1, -1, 0)
shigemk2/haskell_abc
perppoint.hs
mit
199
0
11
81
163
90
73
6
1
module Rebase.Foreign.Marshal.Utils ( module Foreign.Marshal.Utils ) where import Foreign.Marshal.Utils
nikita-volkov/rebase
library/Rebase/Foreign/Marshal/Utils.hs
mit
107
0
5
12
23
16
7
4
0
-- Solutions for the "Reverse a List" excercise at shuklan.com -- http://shuklan.com/haskell -- -- Description: -- http://shuklan.com/haskell/lec02.html#/0/14 -- -- Author: Tamas Gal rev [] = [] rev xs = last xs : rev (init xs)
tamasgal/haskell_exercises
shuklan.com/myfunction.hs
mit
232
0
8
39
44
24
20
2
1
module Rebase.Data.Profunctor.Unsafe ( module Data.Profunctor.Unsafe ) where import Data.Profunctor.Unsafe
nikita-volkov/rebase
library/Rebase/Data/Profunctor/Unsafe.hs
mit
110
0
5
12
23
16
7
4
0
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.RTCSessionDescriptionCallback (newRTCSessionDescriptionCallback, newRTCSessionDescriptionCallbackSync, newRTCSessionDescriptionCallbackAsync, RTCSessionDescriptionCallback) wh...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/RTCSessionDescriptionCallback.hs
mit
2,830
0
13
663
532
316
216
47
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Prelude import qualified Data.Configurator as Conf import qualified Data.Text as T import qualified Data.Text.Encoding as TE import qualified Data.MarkovChain as MC import System.Random (RandomGen, getStdGen) import System.Environment (getArgs) import Contr...
passy/Horse.hs
Main.hs
mit
2,370
0
14
503
703
368
335
53
1
module PGParseCheck.QQ (psql) where import qualified Language.Haskell.TH as TH import Language.Haskell.TH.Quote import qualified PGParseCheck.Bindings as B psql :: QuasiQuoter psql = QuasiQuoter { quoteExp = quoteExpParser , quotePat = undefined , quoteDec = undefined , quoteType = undefined } qu...
teh/pgparsecheck
lib/PGParseCheck/QQ.hs
mit
523
0
13
115
161
90
71
17
2
module SFML.Audio.Listener ( setGlobalVolume , getGlobalVolume , setListenerPosition , getListenerPosition , setListenerDirection , getListenerDirection , setListenerUpVector , getListenerUpVector ) where import SFML.System.Vector3 import Control.Monad ((>=>)) import Foreign.C.Types import Foreign....
SFML-haskell/SFML
src/SFML/Audio/Listener.hs
mit
4,200
0
8
633
553
311
242
51
1
----------------------------------------------------------------------------- -- -- Module : Drool.Types -- Copyright : 2012, Tobias Fuchs -- License : MIT -- -- Maintainer : twh.fuchs@gmail.com -- Stability : experimental -- Portability : POSIX -- -- | -- ----------------------------------------------...
fuchsto/drool
src/Drool/Types.hs
mit
3,504
0
10
595
757
436
321
55
2
{-# LANGUAGE TupleSections #-} module PureScript.Ide.Reexports where import Data.Maybe import Data.Map (Map) import qualified Data.Map as Map import Data.List (union) import PureScript.Ide.Types getReexports :: Module -> [ExternDecl] getReexports (mn, decls)= mapMaybe getExport decls where getExport e@(Export mn') ...
nwolverson/psc-ide
src/PureScript/Ide/Reexports.hs
mit
1,516
0
13
354
483
262
221
34
2
module PoetryDiagramsSpec (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
myw/poetry-diagrams
test/PoetryDiagramsSpec.hs
gpl-2.0
211
0
13
49
74
39
35
9
1
{-# LANGUAGE GeneralizedNewtypeDeriving, GADTs, PackageImports #-} module MarXup.MultiRef where import Control.Monad.Fix import Control.Monad.RWS.Lazy import Data.Map.Strict (Map,insert) import qualified Data.Map.Strict as M import Graphics.Diagrams.Core (BoxSpec, nilBoxSpec) type MetaData key = Map key String type B...
jyp/MarXup
MarXup/MultiRef.hs
gpl-2.0
1,489
0
11
287
484
269
215
34
2
greet :: String -> String greet = catstr "Hello "
hmemcpy/milewski-ctfp-pdf
src/content/1.9/code/haskell/snippet05.hs
gpl-3.0
49
0
5
9
18
9
9
2
1
alpha :: forall x. (Int -> x) -> [x] alpha h = map h [12]
hmemcpy/milewski-ctfp-pdf
src/content/2.4/code/haskell/snippet10.hs
gpl-3.0
57
0
8
14
41
22
19
-1
-1
--16-9 Create a Sudoku solver --this version is taken from Richard Bird's "Pearls of Functional Algorithm Design" import Data.List ((\\)) type Matrix a = [Row a] type Row a = [a] type Grid = Matrix Digit type Digit = Char type Choices = [Digit] digits = ['1'..'9'] blank = (=='0') solve = filter valid . expand . pru...
cem3394/EPI-Haskell
16-09_sudokuSolver2.hs
gpl-3.0
2,120
0
12
496
1,127
627
500
61
2
#!/usr/bin/runhaskell -- |This program checks the length of lines and trailing whitespaces -- in a file. module SourceCheck.CheckFormat where import Data.Char import System.Environment import System.Exit import Data.Maybe type LineNumber = Integer data CheckError = LineTooLong | TrailingWhitespaces lengthOk :: S...
seppeljordan/checkformat
SourceCheck/CheckFormat.hs
gpl-3.0
2,451
0
11
611
747
375
372
66
2
import Pipes main :: IO() main = putStrLn "foo"
Toeplitz/haskell
HvtPipes.hs
gpl-3.0
50
0
6
11
22
11
11
3
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} module Hledger.Cli.Commands.Equity ( equitymode ,equity ) where import Data.Maybe import Data.String.Here import Data.Time.Calendar import Hledger import Hledger.Cli.CliOptions equitymode = hledgerCommandMode [here| equity Print a "closing balance...
ony/hledger
hledger/Hledger/Cli/Commands/Equity.hs
gpl-3.0
3,362
0
17
705
510
291
219
37
1
module Expires (expiresTests) where import Util -- 5.1.1. timeParseTest valid n xs = sessionTest ("Time parsing: " ++ xs) $ do recv (time $ n - 1) e $ cs ++ "; Expires=" ++ xs send (time $ n - 1) e cs if valid then noSend (time n) e -- An invalid date doesn't invalidate the whole-cookie, so it becomes ...
ktvoelker/cookie-jar
test/Expires.hs
gpl-3.0
3,243
0
14
680
820
430
390
56
2
-- By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. -- What is the 10001st prime number? main :: IO () main = putStrLn $ show $ (filter isPrime [1..]) !! 10001 divides :: Int -> Int -> Bool divides x d = (mod x d) == 0 isPrime :: Int -> Bool isPrime x = not $ any (...
peri4n/projecteuler
haskell/problem7.hs
gpl-3.0
370
0
12
83
132
69
63
6
1
<?xml version='1.0' encoding='ISO-8859-1' ?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 1.0//EN" "http://java.sun.com/products/javahelp/helpset_1_0.dtd"> <helpset version="1.0"> <!-- title --> <title>Xena - Help</title> <!-- maps --> <maps> <homeID>...
srnsw/xena
plugins/html/doc/HtmlHelp.hs
gpl-3.0
610
43
35
111
227
115
112
-1
-1
module Main where import System.Environment import Text.Parsec (parse) import Types import Parser import Interpreter main = do args <- getArgs if length args == 0 then putStrLn $ "Usage: " ++ "<program> <input>" else do progText <- readFile $ args!!0 let (Right prog) = parse program (args!!0) pr...
gltronred/braidf-ck
braidf-ck.hs
gpl-3.0
448
0
15
104
168
84
84
16
2
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DeriveDataTypeable #-} module Database.Design.Ampersand.FSpec.ShowMeatGrinder (makeMetaPopulationFile,MetaType(..)) where import Data.List import Data.Char import Data.Ord import Data.Hashable (hash) -- a not good enouqh function, ...
guoy34/ampersand
src/Database/Design/Ampersand/FSpec/ShowMeatGrinder.hs
gpl-3.0
23,635
0
30
6,610
7,076
3,664
3,412
469
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-servicemanagement/gen/Network/Google/Resource/ServiceManagement/Services/Rollouts/Create.hs
mpl-2.0
6,595
0
18
1,417
806
478
328
116
1
-- | An example program that simply connects to the first available -- MTP device and printing the device's firmware version. import MTP import MTP.Handle main = do h <- getFirstDevice print =<< getDeviceVersion h releaseDevice h closed <- isClosed h print closed print =<< getDeviceVersion h
joachifm/hsmtp
examples/Connect.hs
lgpl-2.1
319
0
8
73
65
29
36
9
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {- Network.Lifx - A Library to interact with Lifx light bulbs. (lifx.co) Copyright (C) 2014 Josh Proehl <josh@daedalusdreams.com> *************************************************************************** This program is free software: you can redistribute it and/or modif...
joshproehl/lifx-haskell
src/Network/Lifx/Core.hs
lgpl-3.0
2,833
0
9
685
178
119
59
17
0
import System.Environment import Text.ParserCombinators.Parsec hiding (spaces) import Control.Monad import qualified Data.Map as Map import Numeric import Data.Char hiding (isSymbol, isNumber) import Control.Monad.Error import System.IO hiding (try) import Data.IORef main = do args <- getArgs case length arg...
spockwangs/scheme.in.haskell
list9.hs
unlicense
18,213
0
15
5,601
6,057
3,085
2,972
-1
-1
module Prob where import Data.Ratio newtype Prob a = Prob { getProb :: [(a, Rational)] } deriving Show instance Functor Prob where fmap f (Prob xs) = Prob $ map (\(x, p) -> (f x, p)) xs instance Monad Prob where return x = Prob [(x, 1 % 1)] -- [(x, p)] >>= f = Prob [(f x, p)] -- (x, p):xs >>= f = Prob ((f x, ...
alexliew/learn_you_a_haskell
code/prob.hs
unlicense
1,002
0
11
235
529
292
237
27
1
-- Copyright 2021 Google LLC -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in ...
google/hs-fin-vec
sint/test/Main.hs
apache-2.0
3,372
0
23
871
1,015
535
480
68
4
module Main where import BasePrelude import Tsds.Prim.Types import Tsds.Prim.Unbox import Tsds.SQL main :: IO () main = putStrLn "Hello World"
buckie/tsds
src/Main.hs
apache-2.0
186
0
6
63
42
25
17
7
1
module Util where import Data.Set ( Set ) import Data.Set as Set ( fromList, member, filter ) type Point = (Int, Int) -- | Generate a list of Point (r, c) according to the width and height -- of the layout in the game, with r is the index of row -- and c is the index of column. gridPoints :: Int -> Int -> [Po...
ljishen/Minesweeper
src/Util.hs
apache-2.0
1,042
0
10
328
394
230
164
16
1
-- | Simple parallel genetic algorithm implementation. -- -- > import AI.GeneticAlgorithm.Simple -- > import System.Random -- > import Text.Printf -- > import Data.List as L -- > import Control.DeepSeq -- > -- > newtype SinInt = SinInt [Double] -- > -- > instance NFData SinInt where -- > rnf (SinInt xs) = rnf xs ...
octopuscabbage/simple-genetic-algorithm
src/AI/GeneticAlgorithm/Simple.hs
bsd-2-clause
6,341
0
19
2,151
1,318
738
580
81
2
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QDirModel.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:35 Warning : this file is machine generated - do not...
keera-studios/hsQt
Qtc/Enums/Gui/QDirModel.hs
bsd-2-clause
2,368
0
18
532
612
313
299
55
1
{-# LANGUAGE TypeFamilies, FlexibleContexts #-} module Network.SearchEngine where import qualified Data.Text as T import qualified Data.Vector as V import Network.HTTP.Types import Network.URL class SearchEngine a where -- I think I'd just rather have a type synonym here, but I run into injectivity stuff da...
kowey/customsearch
Network/SearchEngine.hs
bsd-3-clause
1,276
0
11
356
249
146
103
24
0
{-# LANGUAGE TemplateHaskell, LambdaCase, RecordWildCards, RankNTypes #-} module AbstractInterpretation.LiveVariable.CodeGenBase where import Data.Int import Data.Word import Data.Set (Set) import Data.Map (Map) import Data.Vector (Vector) import qualified Data.Bimap as Bimap import qualified Data.Map as Map import q...
andorp/grin
grin/src/AbstractInterpretation/LiveVariable/CodeGenBase.hs
bsd-3-clause
7,164
0
17
1,525
2,179
1,150
1,029
164
10
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-} -- | <http://www.libtorrent.org/reference-Core.html#torrent_status torrent_status> for "Libtorrent" module Network.Libtorrent.TorrentHandle.Torr...
eryx67/haskell-libtorrent
src/Network/Libtorrent/TorrentHandle/TorrentStatus.hs
bsd-3-clause
20,908
0
11
6,558
4,235
2,293
1,942
404
1
{-# LANGUAGE RecursiveDo, BangPatterns #-} module Main where import Control.StartStop.Gloss import Control.StartStop.Run (runACoreBehavior) import Control.StartStop.Class import Control.Monad import Graphics.Gloss import Graphics.Gloss.Data.Extent import Graphics.Gloss.Interface.IO.Game as Gloss import Data.Foldable...
tylerwx51/StartStopFRP
main.hs
bsd-3-clause
5,986
0
17
1,367
2,246
1,165
1,081
102
2
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE CPP #-} #if __GLASGOW_HASKELL__ >= 800 {-# OPTIONS_GHC -fno-warn...
cdornan/idiot
Text/RE/TDFA/Sequence.hs
bsd-3-clause
2,514
0
10
669
538
314
224
50
1
module Text.Authoring ( module Text.Authoring.Class, module Text.Authoring.Combinator, module Text.Authoring.Bibliography, module Text.Authoring.Label, ) where import Text.Authoring.Bibliography import Text.Authoring.Class import Text.Authoring.Combinator import Text.Authoring.Label
nushio3/authoring
src/Text/Authoring.hs
bsd-3-clause
310
0
5
47
61
42
19
9
0