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 ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} module Acquire.Net (PortNumber, runServer, runPlayer, runNewGame, listGames, module Acquire.Net.Types) where import Acquire.Net.Game import Acquire.Net.Player import Acquire.Net....
abailly/hsgames
chinese/src/Chinese/Net.hs
apache-2.0
364
0
5
83
57
39
18
8
0
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, GADTs, MultiWayIf #-} module Main (main) where import Control.Monad (foldM, forM, void) import Data.Map (Map) import qualified Data.Map as Map import qualified Data.IntMap as IntMap import qualified Data.Set as Set import C...
NicolasT/kontiki
bin/udp.hs
bsd-3-clause
8,074
0
22
2,719
2,490
1,316
1,174
175
9
import Text.JSON import Network.RPC.JSON import System.Exit main = do case (decode test1 :: Result JSRequest) of Ok _ -> exitWith ExitSuccess test1 = "{\"method\":\"feed.add\",\"params\":{\"uri\":\"http://rss.slashdot.org/Slashdot/slashdot\"},\"version\":\"1.1\" }"
sof/json
tests/Unit.hs
bsd-3-clause
288
0
10
47
58
30
28
8
1
{-# LANGUAGE OverloadedStrings #-} module Network.Wai.Handler.WebSockets ( websocketsOr , websocketsApp , isWebSocketsReq , getRequestHead , runWebSockets ) where import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as BC import qu...
rgrinberg/wai
wai-websockets/Network/Wai/Handler/WebSockets.hs
mit
4,435
0
17
1,123
687
383
304
64
3
module Paper.Haskell2.All(haskell2) where import System.Process.Extra import System.FilePath import Paper.Haskell2.Stage1 import Paper.Haskell2.Stage2 import Paper.Haskell2.Stage3 haskell2 :: FilePath -> [FilePath] -> IO () haskell2 obj files = mapM_ f files where f file = do putStrLn $ "Ch...
saep/neil
src/Paper/Haskell2/All.hs
bsd-3-clause
601
0
14
171
190
96
94
15
1
-- -- Copyright (c) 2011 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 version 2 of the License, or -- (at your option) any later version. -- -- This progra...
crogers1/manager
updatemgr/UpdateMgr/DbReqHandler.hs
gpl-2.0
1,110
0
7
197
149
86
63
10
1
module E2 where --Any type/data constructor name declared in this module can be renamed. --Any type variable can be renamed. --Rename type Constructor 'BTree' to 'MyBTree' data BTree a = Empty | T a (BTree a) (BTree a) deriving Show buildtree :: Ord a => [a] -> BTree a buildtree [] = Empty buildtree...
kmate/HaRe
old/testing/asPatterns/E2.hs
bsd-3-clause
589
0
9
133
228
123
105
13
1
{-# Language QuantifiedConstraints #-} {-# Language StandaloneDeriving #-} {-# Language DataKinds #-} {-# Language TypeOperators #-} {-# Language GADTs #-} {-# Language KindSignatures #-} {-# Language FlexibleInstances #-} {-# Language UndecidableInstances #-} {-# Language MultiParamTypeClasses #-} {-# Language RankNTy...
sdiehl/ghc
testsuite/tests/typecheck/should_compile/T14735.hs
bsd-3-clause
642
0
8
126
173
94
79
-1
-1
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# LANGUAGE KindSignatures #-} module T7903 where instance Eq (((->) a :: * -> *) b) instance (Ord b) => Ord (((->) a) b)
urbanslug/ghc
testsuite/tests/typecheck/should_compile/T7903.hs
bsd-3-clause
177
2
10
30
67
37
30
5
0
module Safetails where safetail :: Eq a => [a] -> [a] safetail xs = if xs == [] then [] else tail xs safetail' :: Eq a => [a] -> [a] safetail' xs | xs == [] = [] | otherwise = tail xs
kaveet/haskell-snippets
modules/lists/Safetails.hs
mit
191
0
9
51
109
56
53
7
2
module ParserAux where import Text.Megaparsec import Text.Megaparsec.String import qualified Text.Megaparsec.Lexer as L spacey :: Parser () spacey = L.space (spaceChar >> return ()) (L.skipLineComment "--") (L.skipBlockComment "{-" "-}") lexeme = L.lexeme spacey symbol = L.symbol spacey many1 p = do v <- p vs <-...
clarissalittler/pi-calculus
ParserAux.hs
mit
690
0
11
153
293
148
145
23
1
module ParserState2 ( Parser , ParserT , ParserState (..) , FuncTable , initParserState , nextLabel , newFunc , lookupFunc ) where import qualified Data.Map as M import Control.Monad.State import Lexer (Token) type FuncTable = M.Map [Char] [Char] data ParserState = ParserState { parserFuncTable ::...
CindyLinz/Talk-HappyMonadFix-Easy-NPassCompiler
ParserState2.hs
mit
1,586
0
14
376
492
263
229
53
2
module ADT where -- data Bool = True | False -- data RGB = RGB Int Int Int -- это констуктор значений. Первое слово RGB -> это имя констуктора red = RGB 255 0 0 -- Optional! -- data Maybee a = Just a | Nothing data T -- Вполне себе валидный тип -- Функция принимающая что угодно и возвращающая что угодно, но стро...
aquatir/remember_java_api
code-sample-haskell/typed_fp_basics_cource/01_algebraic_data_structures/code.hs
mit
1,845
0
8
384
426
237
189
-1
-1
{- arch-tag: HVFS tests main file Copyright (C) 2004-2011 John Goerzen <jgoerzen@complete.org> All rights reserved. For license and copyright information, see the file LICENSE -} module HVFStest(tests) where import Test.HUnit import System.IO.HVIO import System.IO.HVFS import System.IO.HVFS.InstanceHelpers import Sy...
haskellbr/missingh
missingh-all/testsrc/HVFStest.hs
mit
4,635
0
16
1,793
1,205
632
573
85
2
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.VTTCue (js_newVTTCue, newVTTCue, js_getCueAsHTML, getCueAsHTML, js_setVertical, setVertical, js_getVertical, getVertical, js_setSnapToLines, setSnapToLines, js_getSnapToLines, getSna...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/VTTCue.hs
mit
7,614
128
10
1,169
1,822
997
825
108
1
{-# LANGUAGE OverloadedStrings #-} module Y2021.M02.D23.Exercise where {-- Name matching is the name of the game for today's Haskell problem. You have a set of named wikidata wineries in "column A" and a set of named graph wineries in "column B." You've already done the exact name-matches, now how do we know which w...
geophf/1HaskellADay
exercises/HAD/Y2021/M02/D23/Exercise.hs
mit
4,958
0
10
858
516
292
224
-1
-1
{-# LANGUAGE DeriveGeneric, DeriveDataTypeable, MultiParamTypeClasses #-} module Syntax where import Unbound.Generics.LocallyNameless import GHC.Generics (Generic) import Data.Typeable (Typeable) type TName = Name Term data Ty = TyNat | TyBool | TyTop | TyBot | TyUnit | TyString...
kellino/TypeSystems
fullSub/Syntax.hs
mit
1,087
0
11
304
336
191
145
45
0
{-# LANGUAGE OverloadedStrings #-} module Yesod.Form.I18n.Dutch where import Yesod.Form.Types (FormMessage (..)) import Data.Monoid (mappend) import Data.Text (Text) dutchFormMessage :: FormMessage -> Text dutchFormMessage (MsgInvalidInteger t) = "Ongeldig aantal: " `Data.Monoid.mappend` t dutchFormMessage (MsgInvali...
yesodweb/yesod
yesod-form/Yesod/Form/I18n/Dutch.hs
mit
1,702
0
7
271
340
189
151
25
1
{-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE CPP #-} -------------------------------------------------------------------- -- | -- Copyright : © Oleg Grenrus 2014 -- License : MIT -- Maintainer: Oleg Grenrus <oleg.grenrus@iki.fi> -- Stability : expe...
phadej/boolean-normal-forms
src/Data/Algebra/Boolean/DNF/Set.hs
mit
3,961
0
13
1,095
1,373
719
654
77
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE PatternGuards #-} -- | A sqlite backend for persistent. -- -- Note: If you prepend @WAL=off @ to your connection string, it will disable -- the write-...
jcristovao/persistent
persistent-sqlite/Database/Persist/Sqlite.hs
mit
13,367
0
20
4,154
3,699
1,925
1,774
329
5
module Errors where import Control.Monad.Error import Data.Word import Text.HTML.TagSoup import Types import TCP (Port) data StatsError = CannotParseTagContent Payload | CodingError String | FragmentationError | HTTPError Payload Payload | IncompleteCapture Word32 Word32 -- wire length, capture length |...
mihaimaruseac/petulant-octo-avenger
src/Errors.hs
mit
1,974
0
8
363
522
280
242
43
0
{-# OPTIONS_GHC -Wwarn #-} -- I anticipate rewriting this, no point fixing warnings module Database.Siege.Flushable where import Control.Concurrent.MVar import Data.IORef data FVar a = FVar (MVar a) (IORef (a, a, IO ())) (MVar ()) -- make it possible to fail a flush newFVar :: s -> IO (FVar s) newFVar s = do m0 ...
DanielWaterworth/siege
src/Database/Siege/Flushable.hs
mit
1,025
0
14
248
551
285
266
31
1
module NetHack.Data.MonsterInstance (MonsterInstance(), MonsterAttributes(), monsterNameTrim, monsterByName, newMonsterInstance, freshMonsterInstance, defaultMonsterAttributes, monsterByAppearance, setAttributes, isHostile, respectsElbereth) where import qualified Data.Map as M impor...
Noeda/Megaman
src/NetHack/Data/MonsterInstance.hs
mit
5,832
0
15
1,316
1,599
817
782
123
5
{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-missing-pattern-synonym-signatures #-} module...
tsahyt/clingo-haskell
src/Clingo/Internal/Types.hs
mit
15,418
0
21
3,350
4,644
2,436
2,208
363
3
{-# LANGUAGE OverloadedStrings #-} import System.IO import System.Environment import System.Process import Control.Monad import Control.Concurrent.Async import qualified Data.ByteString as B splitSize = 20 * 1024 * 1024 -- 128 Mega Bytes download :: String -> String -> IO () download url fname = do system $ "curl -...
hlambda/Downloader
down.hs
gpl-2.0
1,560
1
16
407
612
303
309
39
2
{-# LANGUAGE DeriveDataTypeable #-} module Keystone.Web.Role.Types where import Data.Data (Typeable) data RoleCreateRequest = RoleCreateRequest { description :: Maybe String , name :: String , enabled :: Maybe Bool ...
VictorDenisov/keystone
src/Keystone/Web/Role/Types.hs
gpl-2.0
375
0
9
152
75
44
31
8
0
module Main where import Counting (sumToN) main :: IO () main = let numbers = [1..100] squares = map (^2) numbers squareSum = (sumToN 100)^2 sumSquares = sum squares in print $ squareSum - sumSquares
liefswanson/projectEuler
app/p1/q6/Main.hs
gpl-2.0
250
0
11
85
88
48
40
10
1
module Tests.GADTHigherOrder where import QFeldspar.MyPrelude import QFeldspar.Expression.GADTHigherOrder import QFeldspar.Variable.Typed import QFeldspar.Conversion as E import QFeldspar.Expression.Conversions.Evaluation.GADTHigherOrder () import qualified QFeldspar.Expression.GADTValue as FGV import QFeldspar.Type....
shayan-najd/QFeldspar
Tests/GADTHigherOrder.hs
gpl-3.0
999
0
16
255
402
225
177
-1
-1
{-# OPTIONS_GHC -fno-warn-orphans #-} -- SJC: is it possible to move this to the prototype part of ampersand? I mean, -- do functions like plugFields and plug-path really need to be here? -- perhaps we can at least move the largest part? module Database.Design.Ampersand.FSpec.Plug (Plugable(..), PlugInfo...
DanielSchiavini/ampersand
src/Database/Design/Ampersand/FSpec/Plug.hs
gpl-3.0
17,884
0
24
5,263
3,007
1,614
1,393
143
8
{-# LANGUAGE DeriveDataTypeable #-} module Raft.Protocol ( initRaft , Command(..) ) where import Prelude hiding (log) import System.Random.MWC import System.Directory import System.IO import Control.Concurrent import Control.Concurrent.MVar import Control.Monad hiding (forM_) import Control.Applicative import Contro...
mwlow/raft-haskell
src/Raft/Protocol.hs
gpl-3.0
28,009
0
24
9,521
7,054
3,606
3,448
596
7
-- | -- Copyright : (c) 2010-2012 Simon Meier, Benedikt Schmidt -- contributing in 2019: Robert Künnemann, Johannes Wocker -- License : GPL v3 (see LICENSE) -- -- Maintainer : Simon Meier <iridcode@gmail.com> -- Portability : portable -- -- Parsing Proofs module Theory.Text.Parser.Proof ( star...
tamarin-prover/tamarin-prover
lib/theory/src/Theory/Text/Parser/Proof.hs
gpl-3.0
4,442
1
16
1,231
1,146
602
544
87
1
module Language.Mulang.Analyzer.ExpectationsAnalyzer ( analyseExpectations) where import Data.Maybe (fromMaybe) import Language.Mulang.Ast (Expression) import Language.Mulang.Analyzer.Analysis (Expectation, QueryResult, ExpectationResult(..)) import Language.Mulang.Analyzer.ExpectationsCompiler (compileExpectation)...
mumuki/mulang
src/Language/Mulang/Analyzer/ExpectationsAnalyzer.hs
gpl-3.0
665
0
8
67
176
101
75
11
1
{-# LANGUAGE JavaScriptFFI #-} module Estuary.WebDirt.Foreign where import GHC.IORef import qualified GHCJS.Prim as Prim import qualified GHCJS.Types as T import qualified GHCJS.Foreign as F import GHCJS.Foreign.Internal import GHCJS.Marshal.Pure foreign import javascript unsafe "$r = new WebDirt('WebDir...
Moskau/estuary
Estuary/WebDirt/Foreign.hs
gpl-3.0
1,014
14
8
149
215
119
96
15
1
{-# LANGUAGE PatternGuards #-} -- | The contents of the \"PART REAL_GUITAR\", \"PART REAL_GUITAR_22\", -- \"PART REAL_BASS\", and \"PART REAL_BASS_22\" tracks. module Data.Rhythm.RockBand.Lex.ProGuitar where import Data.Rhythm.RockBand.Common import qualified Sound.MIDI.File.Event as E import qualified Sound.MIDI.File...
mtolly/rhythm
src/Data/Rhythm/RockBand/Lex/ProGuitar.hs
gpl-3.0
6,368
0
25
1,610
2,339
1,194
1,145
170
33
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-books/gen/Network/Google/Resource/Books/Bookshelves/Volumes/List.hs
mpl-2.0
4,951
0
19
1,214
744
430
314
106
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/DeleteVolume.hs
mpl-2.0
4,434
0
9
909
460
284
176
55
1
{-# LANGUAGE BangPatterns #-} {-# OPTIONS_GHC -XGeneralizedNewtypeDeriving #-} module Internal.Types where import Control.Monad.Except import Control.Monad.State.Strict import qualified Data.Map as Map import Data.IORef import qualified TclObj as T import qualified EventMgr as Evt import Control.Applicative import Ut...
tolysz/hiccup
Internal/Types.hs
lgpl-2.1
3,018
0
12
799
911
518
393
122
2
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} -------------------------------------------------------------------------------- {-| Module : Window Copyright : (c) Daan Leijen 2003 License : wxWindows Maintainer : wxhaskell-devel@lists.sourceforge.net Stability : provisional Portabili...
ekmett/wxHaskell
wx/src/Graphics/UI/WX/Window.hs
lgpl-2.1
15,573
0
19
4,469
3,438
1,750
1,688
273
5
{-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module: SwiftNav.SBP.System -- Copyright: Copyright (C) 2015 Swift Navigation, Inc. -- License: LGPL-3 -- Maintainer: Mark Fine <dev@swiftnav.com> -- Stability: experimental -- Portability: portable -- -- Standardized system messages from Swift Navigati...
swift-nav/libsbp
haskell/src/SwiftNav/SBP/System.hs
lgpl-3.0
2,725
0
11
460
432
243
189
-1
-1
--função simples de média mediaDeDoisNumeros numero1 numero2 = (numero1 + numero2) / 2 resultadoDaMediaDeDoisNumeros = mediaDeDoisNumeros 2 5 resultadoDaMediaDeDoisNumeros_UsandoInfixNotation = 2 `mediaDeDoisNumeros` 5 resultadoDaMediaDaMedia = (2 `mediaDeDoisNumeros` 5) `mediaDeDoisNumeros` 10 --verificação de um nú...
leonardi-tutorials/tutorial-haskell
Main.hs
apache-2.0
1,969
0
9
334
437
247
190
27
2
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell, OverloadedStrings, DeriveDataTypeable #-} import System.Console.CmdArgs.FromHelp import System.Console.CmdArgs hiding (cmdArgsHelp) import System.Environment (getArgs) {-printHelp :: Annotate Ann -> IO ()-} {-printHelp a = print =<< (cmdArgs_ a :: IO FromHelpA...
gregwebs/ParseHelp.hs
test/Help.hs
bsd-2-clause
1,189
0
12
230
130
74
56
14
2
module Database.SqlServer.Definition.FullTextStopList ( FullTextStopList ) where import Database.SqlServer.Definition.Identifier import Database.SqlServer.Definition.Entity import Test.QuickCheck import Text.PrettyPrint import Control.Monad data FullTextStopList = FullTextStopList { stop...
SuperDrew/sql-server-gen
src/Database/SqlServer/Definition/FullTextStopList.hs
bsd-2-clause
1,025
0
18
257
273
144
129
24
0
-- -- Copyright (c) 2013, Carl Joachim Svenn -- 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...
karamellpelle/MEnv
source/GUI/Widget/BorderWidget.hs
bsd-2-clause
4,281
0
13
963
827
428
399
61
1
module Drasil.GlassBR.DataDefs (aspRat, dataDefs, dimLL, qDefns, glaTyFac, hFromt, loadDF, nonFL, risk, standOffDis, strDisFac, tolPre, tolStrDisFac, eqTNTWDD, probOfBreak, calofCapacity, calofDemand, pbTolUsr, qRef) where import Control.Lens ((^.)) import Language.Drasil import Language.Drasil.Code (asVC') im...
JacquesCarette/literate-scientific-software
code/drasil-example/Drasil/GlassBR/DataDefs.hs
bsd-2-clause
9,696
0
18
1,536
2,973
1,635
1,338
195
3
-- | Parses OCaml cil_types.mli file and generates an equivalent CIL.hs file and a supporting Frama-C plugin (-dumpcil). module Main (main) where import Data.Char import Data.List hiding (group) import System.Process import Text.ParserCombinators.Poly.Plain import Text.Printf main :: IO () main = do f <- readFile "...
tomahawkins/cil
attic/GenCIL.hs
bsd-3-clause
14,544
0
26
3,572
4,616
2,419
2,197
307
18
-- 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. {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.HE.Rules ( rules ) where i...
facebookincubator/duckling
Duckling/Numeral/HE/Rules.hs
bsd-3-clause
9,005
0
18
2,455
2,574
1,440
1,134
289
10
{-# LANGUAGE JavaScriptFFI, TypeSynonymInstances, OverloadedStrings, FlexibleInstances #-} module Famous.Core.Basic where import GHCJS.Foreign import GHCJS.Marshal import GHCJS.Types import qualified JavaScript.Object as Obj import JavaScript.Object.Internal as Obj import qualified Data.Map as Map import Control.Monad...
manyoo/ghcjs-famous
src/Famous/Core/Basic.hs
bsd-3-clause
903
0
13
209
234
130
104
26
1
module Samsum ( findBetween ) where import Data.Char sumByDigits :: [Int] -> Int sumByDigits xs = sum $ map charToInt $ concatMap show xs where charToInt = \c -> ord c - ord '0' infiniteSeq :: Int -> Int -> [Int] infiniteSeq incr from = if from <= 0 ...
hackle/hscripting
src/Samsum.hs
bsd-3-clause
1,314
0
12
571
421
224
197
22
2
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 The @Inst@ type: dictionaries or method instances -} {-# LANGUAGE CPP, MultiWayIf, TupleSections #-} module Inst ( deeplySkolemise, topInstantiate, topInstantiateInferred, deeplyInstantiate, instCall...
GaloisInc/halvm-ghc
compiler/typecheck/Inst.hs
bsd-3-clause
31,342
8
17
9,673
5,667
2,960
2,707
417
7
-- | An example of how AJAX can be done in Fay. This module Demo.actually -- imports the real SharedTypes and Client.API modules used to run -- this IDE. So any requests you make are actual real requests to -- the server. You can inspect their source in the “Internal -- modules” section on this page. module De...
faylang/fay-server
modules/project/Demo/AJAX.hs
bsd-3-clause
738
0
13
147
148
74
74
12
1
-- | Module Main embodies all modules, also have some helper functions to A*. module Main where import AStar import Hyrule import Renderer import Parser import Data.Array import Data.Foldable (find) import Data.List (nub) import qualified Data.Map.Strict as Map import Data.Maybe (fromJust) findObject :: Object -> Ar...
trxeste/wrk
haskell/TrabalhoIA/src/Main_old.hs
bsd-3-clause
6,582
1
20
1,612
1,965
1,015
950
107
5
module TransparentCache where import Control.Concurrent import Control.Concurrent.MSampleVar import Control.Monad import qualified Data.Set as Set import qualified Data.Map as Map import Data.ByteString.Lazy (ByteString) import Frenetic.NetCore import Frenetic.NetworkFrames (arpReply) import System.Log.Logger import S...
frenetic-lang/netcore-1.0
examples/TransparentCache.hs
bsd-3-clause
6,576
0
24
1,799
1,732
812
920
-1
-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. {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.CA...
facebookincubator/duckling
Duckling/Numeral/CA/Rules.hs
bsd-3-clause
8,005
0
17
1,941
2,299
1,329
970
244
5
{-# LANGUAGE TypeFamilies, DataKinds, OverloadedStrings, FlexibleContexts #-} -- | Allow to select a 'SQLFragment' as tuple with a type signature -- corresponding to SQLFragment type. -- -- @ -- let itemCode = "code.items" :: SQLFragment '[String] '[] -- let itemPrice = "price.items" :: SQLFragment '[Double] '[] -- --...
maxigit/sql-fragment-mysql-simple
src/Database/SQLFragment/MySQL/Simple/Tuple.hs
bsd-3-clause
4,223
0
11
835
1,942
1,120
822
49
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} module Mir.Compositional.Clobber where import Control.Lens ((^.), (^?), ix) import Control.Monad.Except import qualified Data.Map as Map import qualified Data.Parameterized.Context as Ctx import Da...
GaloisInc/saw-script
crux-mir-comp/src/Mir/Compositional/Clobber.hs
bsd-3-clause
8,664
0
18
1,989
2,428
1,239
1,189
-1
-1
module Semant ( ExpTy(..), semant ) where import AbSyn import Control.Monad import Control.Monad.Trans.Class import Control.Monad.Trans.Error import Control.Monad.Trans.Reader import Control.Monad.Trans.State import Data.Functor.Identity import Env import Symbol import qualified Translate import qualified Types -----...
svenpanne/tiger
chapter05/src/Semant.hs
bsd-3-clause
9,168
0
17
1,788
3,267
1,563
1,704
232
15
{-# OPTIONS -fglasgow-exts #-} {-# LANGUAGE IncoherentInstances #-} {-# LANGUAGE UndecidableInstances #-} module Graphics.Ubigraph.Fgl ( addGraph, pathVertexColor, ) where import Data.Graph.Inductive import Data.Graph.Inductive.Graph import qualified Graphics.Ubigraph as H mkEdgeId :: Edge -> Int mkEdgeId (src...
smly/hubigraph
Graphics/Ubigraph/Fgl.hs
bsd-3-clause
1,372
0
11
274
587
300
287
-1
-1
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell [lq| (>>=) :: m a -> (a -> m b) -> m b |]
spinda/liquidhaskell
tests/gsoc15/unknown/pos/PlugHoles.hs
bsd-3-clause
96
0
4
24
12
8
4
3
0
module Init.Guide (init, chapters) where import Control.Monad (when) import qualified Data.Maybe as Maybe import Prelude hiding (init) import System.Exit (exitFailure) import System.FilePath ((</>), (<.>)) import qualified Init.FileTree as FT import Init.Helpers (makeWithStyle, write, isOutdated) -- CHAPTERS chapt...
FranklinChen/elm-lang.org
src/backend/Init/Guide.hs
bsd-3-clause
2,203
0
22
659
621
324
297
73
3
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Data.Semigroup.Instances () where import Data.Semigroup import Data.VectorSpace hiding (Sum) import Data.AffineSpace import Control.Applicative import Music.Pitch.Litera...
FranklinChen/music-score
src/Data/Semigroup/Instances.hs
bsd-3-clause
2,205
0
8
432
682
333
349
43
0
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings, TupleSections #-} --http://julien.jhome.fr/posts/2013-05-14-adding-toc-to-posts.html module TableOfContents where import Data.Monoid import qualified Data.Set as S import Hakyll im...
holdenlee/philosophocle
src/TableOfContents.hs
mit
1,038
0
11
343
144
82
62
18
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-ses/gen/Network/AWS/SES/GetIdentityVerificationAttributes.hs
mpl-2.0
5,402
0
14
1,019
586
353
233
74
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/ListGateways.hs
mpl-2.0
4,730
0
12
1,045
686
406
280
72
1
{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-}...
rubik/stack
src/Stack/Build.hs
bsd-3-clause
13,959
0
18
4,466
2,883
1,540
1,343
232
6
{-| Module : Data.STM.Bag.Internal.ListBag Description : STM-based Concurrent Bag data structure implementation Copyright : (c) Alex Semin, 2015 License : BSD3 Maintainer : alllex.semin@gmail.com Stability : experimental Portability : portable Implementation of the 'Data.STM.Bag.Class' using coarse-grain...
Alllex/stm-data-collection
src/Data/STM/Bag/Internal/ListBag.hs
bsd-3-clause
1,089
0
11
267
310
160
150
26
2
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Data/Text/Internal/Fusion/Types.hs" #-} {-# LANGUAGE BangPatterns, ExistentialQuantification #-} -- | -- Module : Data.Text.Internal.Fusion.Types -- Copyright : (c) Tom Harper 2008-2009, -- (c) Bryan O'Sullivan 2009, -- (c) Duncan Coutts 2009, --...
phischu/fragnix
tests/packages/scotty/Data.Text.Internal.Fusion.Types.hs
bsd-3-clause
4,169
0
12
1,387
898
489
409
92
8
{- scheduled activities - - Copyright 2013-2014 Joey Hess <joey@kitenet.net> - - License: BSD-2-clause -} module Utility.Scheduled ( Schedule(..), Recurrance(..), ScheduledTime(..), NextTime(..), WeekDay, MonthDay, YearDay, nextTime, calcNextTime, startTime, fromSchedule, fromScheduledTime, toSchedu...
avengerpenguin/propellor
src/Utility/Scheduled.hs
bsd-2-clause
11,685
142
18
2,451
4,379
2,218
2,161
324
18
module A (caf, c_two) where import Debug.Trace (trace) data C = C Int Int caf :: C caf = C 3 (trace "value forced" 4) c_two :: C -> Int c_two (C _ b) = b
sdiehl/ghc
testsuite/tests/ghci/T16392/A.hs
bsd-3-clause
158
0
7
40
81
45
36
7
1
{-# LANGUAGE TypeFamilies #-} module T8227 ( absoluteToParam ) where import T8227a type family Scalar a :: * type instance Scalar (a -> v) = a -> Scalar v arcLengthToParam :: Scalar (V p) -> p -> Scalar (V p) -> Scalar (V p) arcLengthToParam = undefined absoluteToParam :: Scalar (V a) -> a -> Scalar (V a) ...
frantisekfarka/ghc-dsi
testsuite/tests/indexed-types/should_fail/T8227.hs
bsd-3-clause
619
0
10
151
142
75
67
11
1
{-# LANGUAGE StandaloneDeriving, GADTs, DeriveDataTypeable #-} module DataCacheTest (tests) where import Haxl.Core.DataCache as DataCache import Haxl.Core import Control.Exception import Data.Hashable import Data.Traversable import Data.Typeable import Prelude hiding (mapM) import Test.HUnit data TestReq a where ...
kantp/Haxl
tests/DataCacheTest.hs
bsd-3-clause
2,164
1
15
464
656
322
334
55
5
{-# LANGUAGE ExistentialQuantification, NamedFieldPuns #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.ParseUtils -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- Parsing utilities. ----------------------------------...
tolysz/prepare-ghcjs
spec-lts8/cabal/cabal-install/Distribution/Client/ParseUtils.hs
bsd-3-clause
9,627
0
15
2,361
2,067
1,101
966
146
5
{-# LANGUAGE DataKinds #-} {-# LANGUAGE ScopedTypeVariables #-} module T12634 where twacePowDec :: t m' r -> t m r twacePowDec = undefined data Bench a bench :: (a -> b) -> a -> Bench params bench f = undefined bench_twacePow :: forall t m m' r . _ => t m' r -> Bench '(t,m,m',r) bench_twacePow = bench (t...
olsner/ghc
testsuite/tests/partial-sigs/should_fail/T12634.hs
bsd-3-clause
351
0
10
83
137
75
62
-1
-1
-- Copyright © 2021 Mark Raynsford <code@io7m.com> https://www.io7m.com -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provided that the above -- copyright notice and this permission notice appear in all copies. -- -- THE SOFTWARE IS PRO...
io7m/jcamera
com.io7m.jcamera.documentation/src/main/resources/com/io7m/jcamera/documentation/haskell/Matrix4f.hs
isc
2,578
0
10
689
863
454
409
73
5
class YesNo a where yesno :: a -> Bool instance YesNo Int where yesno 0 = False yesno _ = True instance YesNo [a] where yesno [] = False yesno _ = True instance YesNo Bool where yesno = id instance YesNo (Maybe a) where yesno (Just _) = True yesno Nothing = False instance YesNo Traf...
v0lkan/learning-haskell
yesno.hs
mit
524
0
8
157
194
99
95
21
2
-- Generated by protobuf-simple. DO NOT EDIT! module Types.Enum where import Prelude () import qualified Data.ProtoBufInt as PB data Enum = Zero | One | Two | Three | Four | Five | Six | Seven | Eight | Nine deriving (PB.Show, PB.Eq, PB.Ord) instance PB.Default Enum where defaultVal = Zero instance PB.Mergeable...
sru-systems/protobuf-simple
test/Types/Enum.hs
mit
818
0
7
197
281
151
130
30
0
{-# LANGUAGE OverloadedStrings #-} module Castor.Std.Logic (exports) where import Control.Applicative import Control.Monad.Error import qualified Data.Map as M import Data.Maybe import Castor.Externs import Castor.Interpreter import Castor.Types ifthenelse :: Value ifthenelse = mkBif [Sym "p", Sym "t", Sym "f", Sym...
rfw/castor
Std/Logic.hs
mit
1,293
0
12
369
499
253
246
33
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeSynonymInstances #-} -- | This module holds the base monads used throughout the library. module Docker.Base ( Docker , Auth(..) , DockerError(..) ...
nahiluhmot/docker-hs
src/Docker/Base.hs
mit
4,915
0
11
1,222
892
498
394
86
1
module Bot ( bot ) where import Vindinium import System.Random (getStdRandom, randomR) import Data.Maybe (fromJust) import Control.Monad (liftM) import Control.Monad.IO.Class (liftIO) bot :: Bot bot = randomBot myBot :: Bot myBot = error "it's up to you :)" randomBot :: Bot randomBot _ = liftM ...
Herzult/vindinium-starter-haskell
src/Bot.hs
mit
852
0
13
227
360
190
170
28
2
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.AllAudioCapabilities (js_getSourceId, getSourceId, js_getVolume, getVolume, AllAudioCapabilities, castToAllAudioCapabilities, gTypeAllAudioCapabilities) where import Prelude ((.), (==...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/AllAudioCapabilities.hs
mit
1,983
12
11
276
477
291
186
35
1
{-# LANGUAGE CPP #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} module Hpack.Syntax.Dependencies ( Dependencies(..) , DependencyInfo(..) , parseDependency ) where import Imports import qualified Control.Monad.Fail as Fail import qualified D...
sol/hpack
src/Hpack/Syntax/Dependencies.hs
mit
2,933
0
20
545
744
414
330
60
3
{-# LANGUAGE DeriveDataTypeable, CPP #-} -- | A lightweight implementation of a subset of Hspec's API. module Test.Hspec ( -- * Types SpecM , Spec -- * Defining a spec , describe , context , it -- ** Setting expectations , Expectation , expect , shouldBe , shouldReturn -- * Running a spec , hspec #ifdef TEST -- *...
hspec/nanospec
src/Test/Hspec.hs
mit
3,825
0
19
914
1,184
622
562
90
3
{- Copyright (c) 2008-2015 the Urho3D project. 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, publis...
Teaspot-Studio/Urho3D-Haskell
app/sample06/Main.hs
mit
13,282
0
18
2,432
2,494
1,177
1,317
-1
-1
{-# LANGUAGE FlexibleContexts #-} module Network.Visualizations ( networkHistogram , weightList , biasList ) where import Network.Layer import Network.Network import Network.Network.FeedForwardNetwork import Network.Neuron import Numeric.LinearAlgebra import ...
mckeankylej/hwRecog
Network/Visualizations.hs
mit
912
0
12
220
237
127
110
23
1
{-# LANGUAGE OverloadedStrings #-} module Main where import qualified Data.ByteString as B import Ketchup.Auth import Ketchup.Httpd import Ketchup.Routing import Ketchup.Utils import Ketchup.Chunked import Ketchup.Static handle hnd req = se...
Hamcha/ketchup
example.hs
mit
1,468
0
11
492
409
221
188
32
1
import Graphics.Rendering.OpenGL as GL import Graphics.UI.GLFW as GLFW import Graphics.Rendering.OpenGL (($=)) import Data.IORef import Control.Monad import System.Environment (getArgs, getProgName) data Action = Action (IO Action) main = do -- invoke either active or passive drawing loop depending on command line ...
dragonly/HasCraft
test_mouse.hs
gpl-2.0
6,114
4
17
1,832
1,493
741
752
114
3
{-# LANGUAGE OverloadedStrings #-} {-| Implementation of the Ganeti confd server functionality. -} {- Copyright (C) 2013 Google 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 version...
badp/ganeti
src/Ganeti/Monitoring/Server.hs
gpl-2.0
8,714
0
14
1,772
1,909
974
935
166
3
module Handler.Wishlist where import Text.Julius (juliusFile, rawJS) import Import import Types (Priority (..)) import Util.Widgets (getSortValue, sortWidget, sortListByOption) -- | A 'Book' 'Entity' & 'WishlistItem' 'Entity' packed into a Tuple. type WishlistItemAndB...
prikhi/MyBookList
Handler/Wishlist.hs
gpl-3.0
3,869
0
20
1,079
827
424
403
-1
-1
{-# LANGUAGE GADTs #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Sepa.BillingConcept ( -- BillingConcept mkBillingConcept, BillingConcept, BillingConceptId, shortName, ...
gmarpons/sepa-debits
Sepa/BillingConcept.hs
gpl-3.0
3,271
0
15
920
744
408
336
58
5
module Sites.Batoto ( batoto ) where import Network.HTTP.Types.URI (decodePathSegments) import Data.List (isInfixOf) import Text.XML.HXT.Core import qualified Data.Text as T import qualified Data.ByteString.Lazy.UTF8 as UL import qualified Data.ByteString.UTF8 as US import qualified Network.HTTP.Conduit as ...
pharaun/hComicFetcher
src/Sites/Batoto.hs
gpl-3.0
4,487
0
24
1,163
1,239
654
585
-1
-1
module LinkedList ( LinkedList , datum , fromList , isNil , new , next , nil , reverseLinkedList , toList ) where data LinkedList a = Nil | Cons a (LinkedList a) datum :: LinkedList a -> a datum (Cons a _) = a datum Nil = undefined fromList :: [a] -> LinkedList a fromList (x :...
daewon/til
exercism/haskell/simple-linked-list/src/LinkedList.hs
mpl-2.0
919
0
9
237
397
202
195
35
2
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RankNTypes, ExistentialQuantification #-} module FoldingThroughAFixedPoint where import Control.Applicative -- Consider the two following types newtype Least f = Least (forall r . (f r -> r) -> r) -- data Greatest f = forall s . Greatest (s...
ice1000/OI-codes
codewars/1-100/folding-through-a-fixed-point.hs
agpl-3.0
2,677
0
15
580
858
448
410
50
2
-------------------------------------------------------------------------------- -- $Id: SwishTest.hs,v 1.10 2004/01/06 13:53:10 graham Exp $ -- -- Copyright (c) 2003, G. KLYNE. All rights reserved. -- See end of this file for licence information. ---------------------------------------------------------------...
amccausl/Swish
Swish/HaskellRDF/SwishTest.hs
lgpl-2.1
6,093
0
10
1,207
618
366
252
71
1
module Main ( main ) where ------------------------------------------------------------------------------ import Test.Framework ( defaultMain ) ------------------------------------------------------------------------------ import Control.Concurrent.Barrier.Test ( tests ) -----------------------------------...
aartamonau/haskell-barrier
tests/test.hs
lgpl-3.0
403
0
6
40
52
32
20
5
1
{-# LANGUAGE TupleSections #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE MultiParamTypeClasses #-} ...
slpopejoy/fadno-xml
src/Fadno/MusicXml/MusicXml30.hs
bsd-2-clause
700,244
0
56
151,409
177,124
92,011
85,113
11,418
1
module Token where import Prelude data Token = X | O | Empty deriving (Eq) instance Show Token where show X = "X" show O = "O" show Empty = "_" tokenValue X = 1 tokenValue Empty = 0 tokenValue O = (-1)
MichaelBaker/haskell-tictactoe
src/Token.hs
bsd-2-clause
228
0
6
69
88
48
40
10
1
{-# LANGUAGE TemplateHaskell #-} module Types ( Error(..) ) where import Data.Aeson.TH import Data.Text.Lazy data Error = Error { errorStatus :: Int , errorMessage :: Text , errorException :: Maybe Text } deriving (Read, Show) $(deriveJSON default...
jotrk/webui-service
src/Types.hs
bsd-2-clause
337
0
9
111
81
48
33
10
0
{-# LANGUAGE Rank2Types, GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} module CodeSyntaxDump where {-# LINE 2 "./src-ag/Patterns.ag" #-} -- Patterns.ag imports import UU.Scanner.Position(Pos) import CommonTypes (ConstructorIdent,Identifier) {-# LINE 11 "dist/build/CodeSyntaxDump.hs" #-} {-# LINE 2 "./src-ag/CodeSyn...
norm2782/uuagc
src-generated/CodeSyntaxDump.hs
bsd-3-clause
53,365
14
22
16,287
10,656
5,865
4,791
847
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} module NXT.Parser.AttoParser ( parseFile , pFullParser ) where import NXT.Types import qualified NXT.Parser.AttoExpr as E import GHC.Float import Data.Attoparsec.Text import Data.Char (isSpace, isAlpha, isAlphaNum) import qualified Data.Tex...
agrafix/legoDSL
NXT/Parser/AttoParser.hs
bsd-3-clause
6,722
0
18
1,857
2,585
1,317
1,268
165
2
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} module Main where import qualified DB import DB (DB) import Data.Aeson (encode) import qualified Data.ByteString.Lazy.Ch...
hlian/atypical
app/Main.hs
bsd-3-clause
1,784
0
16
454
688
347
341
-1
-1
module Simplifier where import Syntax import Substitution -- Simplify PE result by inlining simplify :: Expr -> FEnv -> (Expr, FEnv) simplify e fs = simplify' e [] fs simplify' :: Expr -> FEnv -> FEnv -> (Expr, FEnv) simplify' e fs [] = (e,fs) simplify' e fs1 (f@(s,(ss,e')):fs2) = if count == 1 then let ...
grammarware/slps
topics/partial-evaluation/simplepe/Simplifier.hs
bsd-3-clause
1,557
0
10
411
708
373
335
43
12