code stringlengths 2 1.05M | repo_name stringlengths 5 101 | path stringlengths 4 991 | language stringclasses 3
values | license stringclasses 5
values | size int64 2 1.05M |
|---|---|---|---|---|---|
{-# LANGUAGE TemplateHaskell #-}
{-| Unittests for the static lock declaration.
-}
{-
Copyright (C) 2016 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code... | onponomarev/ganeti | test/hs/Test/Ganeti/JQueue/LockDecls.hs | Haskell | bsd-2-clause | 5,098 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Stack.Dot (dot
,listDependencies
,DotOpts(..)
,DotPayload(..)
,ListDepsOpts(... | juhp/stack | src/Stack/Dot.hs | Haskell | bsd-3-clause | 25,549 |
module Sql.Utils where
import Database.HDBC
import Database.HDBC.Sqlite3
import Data.Maybe
import Types
conn :: IO Connection
conn = connectSqlite3 "hunter.db"
fetch :: Connection -> String -> [SqlValue] -> IO (Maybe [SqlValue])
fetch c s vs = do
com <- prepare c s
execute com vs
fetchRow com
lastRowId ... | hherman1/CatanServ | src/Sql/Utils.hs | Haskell | bsd-3-clause | 467 |
-- | Item and treasure definitions.
module Content.ItemKind ( cdefs ) where
import qualified Data.EnumMap.Strict as EM
import Data.List
import Content.ItemKindActor
import Content.ItemKindBlast
import Content.ItemKindOrgan
import Content.ItemKindTemporary
import Game.LambdaHack.Common.Ability
import Game.LambdaHack.C... | Concomitant/LambdaHack | GameDefinition/Content/ItemKind.hs | Haskell | bsd-3-clause | 38,245 |
module Nullable where
import FFI
data R = R (Nullable Double)
main :: Fay ()
main = do
printD $ Nullable (1 :: Double)
printNS $ Nullable "Hello, World!"
printSS $ Defined ["Hello,","World!"]
printD $ (Null :: Nullable Double)
print' $ R (Nullable 1)
print' $ R Null
print' $ r1
print' $ r2
... | beni55/fay | tests/Nullable.hs | Haskell | bsd-3-clause | 965 |
{-# LANGUAGE Haskell98, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-}
{-# LINE 1 "Control/Monad/List.hs" #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.List
-- Copyright : (c) Andy Gill 2001,
-- (c) Oregon G... | phischu/fragnix | tests/packages/scotty/Control.Monad.List.hs | Haskell | bsd-3-clause | 832 |
{-# Language PatternGuards #-}
module Blub
( blub
, foo
, bar
) where
import Control.Applicative
(r, t, z)
import Control.Foo (foo)
import Ugah.Blub
( a
, b
, c
)
f :: Int -> Int
f = (+ 3)
r :: Int -> Int
r =
| jystic/hsimport | tests/goldenFiles/SymbolTest32.hs | Haskell | bsd-3-clause | 237 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Extra functions for optparse-applicative.
module Options.Applicative.Builder.Extra
(boolFlags
,boolFlagsNoDefault
,firstBoolFlagsNoDefault
,firstBoolFlagsTrue
,firstBoolFlagsFalse
,enableDisableFl... | juhp/stack | src/Options/Applicative/Builder/Extra.hs | Haskell | bsd-3-clause | 11,661 |
module Hint.Type(module Hint.Type, module Idea, module HSE.All, module Refact) where
import Data.Monoid
import HSE.All
import Idea
import Prelude
import Refact
type DeclHint = Scope -> Module_ -> Decl_ -> [Idea]
type ModuHint = Scope -> Module_ -> [Idea]
type CrossHint = [(Scope, Module_)] -> [Idea]
-- | ... | mpickering/hlint | src/Hint/Type.hs | Haskell | bsd-3-clause | 1,300 |
{-# OPTIONS_GHC -XGADTs -XRankNTypes -O1 #-}
-- #2018
module Bug1 where
data A a where
MkA :: A ()
class C w where
f :: forall a . w a -> Maybe a
instance C A where
f MkA = Just ()
| sdiehl/ghc | testsuite/tests/typecheck/should_compile/tc241.hs | Haskell | bsd-3-clause | 198 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-| Unittests for the 'Ganeti.Common' module.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the fol... | grnet/snf-ganeti | test/hs/Test/Ganeti/Common.hs | Haskell | bsd-2-clause | 7,765 |
{-# LANGUAGE RebindableSyntax, NPlusKPatterns #-}
module Main where
{
-- import Prelude;
import qualified Prelude;
import Prelude(String,undefined,Maybe(..),IO,putStrLn,
Integer,(++),Rational, (==), (>=) );
import Prelude(Monad(..),Applicative(..),Functor(..));
... | ezyang/ghc | testsuite/tests/rebindable/rebindable2.hs | Haskell | bsd-3-clause | 4,854 |
{-# LANGUAGE DataKinds, KindSignatures, TypeFamilies #-}
module T9263a where
import T9263b
import Data.Proxy
data Void
instance PEq ('KProxy :: KProxy Void)
| urbanslug/ghc | testsuite/tests/polykinds/T9263a.hs | Haskell | bsd-3-clause | 160 |
module Main where
import LambdaPi.Bound
import Test.Tasty
import Test.Tasty.HUnit
assertType :: String -> TestName -> (Expr Int, Expr Int) -> TestTree
assertType s n (e, t) = testCase n $ assertBool s (hasType e t)
consts :: TestTree
consts = testGroup "Constant Tests"
[ assertType "ETrue is wrong" "True" (E... | jozefg/cooked-pi | test/Bound.hs | Haskell | mit | 838 |
{-# LANGUAGE RecordWildCards, NamedFieldPuns #-}
module Language.Plover.Simplify
(simplify, Expr(..))
where
import qualified Data.Map.Strict as M
import Control.Monad (foldM)
import Data.Maybe (mapMaybe)
-- TODO add rebuild to atom
data Expr e num
= Sum [(Expr e num)]
| Mul [(Expr e num)]
| Atom e
| Prim num... | swift-nav/plover | src/Language/Plover/Simplify.hs | Haskell | mit | 2,146 |
-- | Implementation of an execution environment that uses /systemdNspawn/.
module B9.SystemdNspawn
( SystemdNspawn (..),
)
where
import B9.B9Config
( getB9Config,
systemdNspawnConfigs,
)
import B9.B9Config.SystemdNspawn as X
import B9.B9Error
import B9.B9Exec
import B9.B9Logging
import B9.BuildInfo
import ... | sheyll/b9-vm-image-builder | src/lib/B9/SystemdNspawn.hs | Haskell | mit | 9,163 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
module IHaskell.Display.Widgets.Bool.ToggleButton (
-- * The ToggleButton Widget
ToggleButton,
-- * Constructor
mkToggleButton) where
-- To keep `cabal re... | beni55/IHaskell | ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Bool/ToggleButton.hs | Haskell | mit | 2,085 |
{-# OPTIONS_GHC -O0 #-}
{-# LANGUAGE TypeOperators, OverloadedStrings, DeriveGeneric #-}
{-# LANGUAGE ScopedTypeVariables, GeneralizedNewtypeDeriving, CPP #-}
-- | Tests that modify the database.
module Tests.Mutable (mutableTests) where
import Control.Concurrent
import Control.Monad.Catch
import Data.ByteString (ByteS... | valderman/selda | selda-tests/test/Tests/Mutable.hs | Haskell | mit | 28,481 |
module Icarus.Bezier (Point(..),
Despair(..),
pointToList,
pointToTuple, tupleToPoint,
bezier,
line1d',
cubic, cubicSeq, trange) where
import Control.Monad (zipWithM)
------------------... | arnau/icarus | src/Icarus/Bezier.hs | Haskell | mit | 5,419 |
-- | Upload to Stackage and Hackage
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE FlexibleContexts #-}
module Stackage.Uplo... | fpco/stackage-curator | src/Stackage/Upload.hs | Haskell | mit | 1,513 |
{-# LANGUAGE NoDeriveAnyClass #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module TokenCSFR ( TokenCSFR()
, csfrChallenge
, correctCSFR
) where
import Database.Persist
import Lucid
import Orphan.UUID
import Proto... | mreider/kinda-might-work | src/TokenCSFR.hs | Haskell | mit | 948 |
{-# OPTIONS -Wall #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE LambdaCase #-}
import Control.Monad (foldM)
import Data.Bool (bool)
import Data.Functor
import qualified Data.List as List
import Data.Ord (comparing)
import Data.Text (Text)
import Data.Vector (Vector, (//))
import qualified Data.Vector as Vector
impor... | SamirTalwar/advent-of-code | 2021/AOC_24_2.hs | Haskell | mit | 4,543 |
{-# htermination (maxOrdering :: Ordering -> Ordering -> Ordering) #-}
import qualified Prelude
data MyBool = MyTrue | MyFalse
data List a = Cons a (List a) | Nil
data Ordering = LT | EQ | GT ;
ltEsOrdering :: Ordering -> Ordering -> MyBool
ltEsOrdering LT LT = MyTrue;
ltEsOrdering LT EQ = MyTrue;
ltEsOr... | ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/max_6.hs | Haskell | mit | 768 |
-- | Evaluators for Language.TaPL.Arith.
module Language.TaPL.Arith.Eval (eval, eval') where
import Control.Applicative ((<$>))
import Language.TaPL.Arith.Syntax (Term(..), isVal, isNumericVal)
-- | Small step evaluator.
eval :: Term -> Maybe Term
eval t | isVal t = Just t
| otherwise =
case eval1... | zeckalpha/TaPL | src/Language/TaPL/Arith/Eval.hs | Haskell | mit | 1,613 |
-- TODO: remove mkApp, unsafeUnApp
{-# LANGUAGE TemplateHaskell, TypeOperators #-}
module Language.CL.C.HOAS.Naming (function, cl) where
import Language.CL.C.HOAS.AST
import Language.CL.C.Types.Classes
import Language.Haskell.TH
import Control.Monad (join)
import Data.Monoid (mempty)
-- | 'function' should be used ... | pxqr/language-cl-c | Language/CL/C/HOAS/Naming.hs | Haskell | mit | 1,848 |
module Javelin.Lib.ByteCode.FieldMethod where
import qualified Data.Binary.Get as Get
import qualified Data.Map.Lazy as Map
import qualified Data.Word as Word
import qualified Javelin.Lib.ByteCode.Attribute as Attribute
import qualified Javelin.Lib.ByteCode.Data as ByteCode
import qualified Javelin.Lib.ByteCode.Utils... | antonlogvinenko/javelin | src/Javelin/Lib/ByteCode/FieldMethod.hs | Haskell | mit | 2,035 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
module Spark.IO.Internal.InputGeneric(
generic',
genericWithSchema',
genericWithSchema,
extractResourcePath,
updateResourceStamp
) where
import Spark.Core.Types
i... | tjhunter/karps | haskell/src/Spark/IO/Internal/InputGeneric.hs | Haskell | apache-2.0 | 2,906 |
-----------------------------------------------------------------------------
-- |
-- Module : Finance.Hqfl.Pricer.Asay
-- Copyright : (C) 2016 Mika'il Khan
-- License : (see the file LICENSE)
-- Maintainer : Mika'il Khan <co.kleisli@gmail.com>
-- Stability : stable
-- Portability : portable
--
----... | cokleisli/hqfl | src/Finance/Hqfl/Pricer/Asay.hs | Haskell | apache-2.0 | 971 |
{-# LANGUAGE BangPatterns #-}
{-# OPTIONS -Wall #-}
----------------------------------------------------------------------
-- |
-- Module : Data.ZoomCache.Multichannel.Internal
-- Copyright : Conrad Parker
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : Conrad Parker <conrad@metadecks.org>
-- Stabi... | kfish/zoom-cache | Data/ZoomCache/Multichannel/Internal.hs | Haskell | bsd-2-clause | 3,084 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DoAndIfThenElse #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Web.Spock.Shared
(-- * Helpers for running Spock
runSpock, spockAsApp
-- * Action... | nmk/Spock | src/Web/Spock/Shared.hs | Haskell | bsd-3-clause | 4,684 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
module Futhark.Optimise.Fusion.LoopKernel
( FusedKer(..)
, newKernel
, inputs
, setInputs
, arrInputs
, kernelType
, transformOutput
, attemptFusion
, SOAC
, MapNest
, toNestedSeqStream --not used!
)
where
import Control.Applicat... | mrakgr/futhark | src/Futhark/Optimise/Fusion/LoopKernel.hs | Haskell | bsd-3-clause | 34,103 |
{-# OPTIONS_GHC
-XFlexibleInstances
-XOverlappingInstances
-XMultiParamTypeClasses
-XFlexibleContexts
-XUndecidableInstances
-XTemplateHaskell
-cpp #-}
module Text.RJson (TranslateField,
TranslateFieldD,
translateField,
ToJson,
... | addrummond/RJson | Text/RJson.hs | Haskell | bsd-3-clause | 31,901 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Types
( Digit
, zero
, one
, two
, three
, four
, five
, six
, seven
, eight
, nine
, Account
, fromList
, Verified
, verify
, verified
) where
newtype Digit = Digit { unDigit :: Int } deriving (Enum,... | mbeidler/kata-bank-ocr | src/Types.hs | Haskell | bsd-3-clause | 1,215 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
module Data.SemVer.Range (
-- * Types
RangeOp(..)
, RangeSpec(..)
... | phadej/semver-range | src/Data/SemVer/Range.hs | Haskell | bsd-3-clause | 10,363 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleInstances #-}... | junjihashimoto/mathflow | src/MathFlow/Core.hs | Haskell | bsd-3-clause | 5,390 |
{-# LANGUAGE TupleSections #-}
module FilePaths
( historyFilePath
, historyFileName
, lastRunStateFilePath
, lastRunStateFileName
, configFileName
, xdgName
, locateConfig
, xdgSyntaxDir
, syntaxDirName
, Script(..)
, locateScriptPath
, getAllScripts
)
where
import Prelude ()
import Prelu... | aisamanra/matterhorn | src/FilePaths.hs | Haskell | bsd-3-clause | 3,926 |
{-# OPTIONS -fglasgow-exts #-}
module GisServer.Data.S57 () where
import Data.Binary
import Data.Binary.Get
import Data.Bits
import Data.Char
import Data.Maybe
import Data.Tree
import qualified Data.Map as M
import Int
import Data.ByteString.Lazy
import GisServer.Data.Common
import GisServer.Data.ISO8211
data S57Dat... | alios/gisserver | GisServer/Data/S57.hs | Haskell | bsd-3-clause | 1,560 |
{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
\section[RnSource]{Main pass of renamer}
-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE ScopedTypeVariables #-}
module RnTypes (
-- Type related stuff
rnHsType, rnLHsType, rnLHsTypes, rnContext,
rnHsKind, rnLHsKind, rnLHsMaybeKind,
rn... | urbanslug/ghc | compiler/rename/RnTypes.hs | Haskell | bsd-3-clause | 49,512 |
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE DataKinds #-}
{-# OPTIONS_GHC -Wall #-}
module Main where
import Tower.Prelude
import Tower.N
import Test.Tasty (TestName, TestTree, testGroup, defaultMain, localOption)
import Test.Tasty.QuickCheck
import Test.DocTest
-- import ... | tonyday567/tower | test/test.hs | Haskell | bsd-3-clause | 30,551 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE... | frms-/aws | Aws/DynamoDb/Core.hs | Haskell | bsd-3-clause | 39,556 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Snaplet.Authentication
( initAuthentication
, Authentication
, requireUser
, withUser
, makeSessionJSON
, module Snaplet.Authenti... | krisajenkins/snaplet-auth | src/Snaplet/Authentication.hs | Haskell | bsd-3-clause | 7,436 |
----------------------------------------------------------------------------
-- |
-- Module : BWildcardExportListWithChildren
-- Copyright : (c) Sergey Vinokurov 2018
-- License : BSD3-style (see LICENSE)
-- Maintainer : serg.foo@gmail.com
----------------------------------------------------------------... | sergv/tags-server | test-data/0012resolve_reexport_import_cycles/BWildcardExportListWithChildren.hs | Haskell | bsd-3-clause | 1,131 |
-- 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 Overl... | rfranek/duckling | Duckling/Time/HR/Corpus.hs | Haskell | bsd-3-clause | 23,505 |
{-# OPTIONS -Wall #-}
-----------------------------------------------------------------------------
-- |
-- Module : CTest.hs (executable)
-- Copyright : (c) 2008 Duncan Coutts, Benedikt Huber
-- License : BSD-style
-- Maintainer : benedikt.huber@gmail.com
-- Portability : non-portable (Data.Generics)
... | jthornber/language-c-ejt | test/src/CTest.hs | Haskell | bsd-3-clause | 4,993 |
;
; HSP help managerp HELP\[Xt@C
; (檪u;vÌsÍRgƵijêÜ·)
;
%type
g£½ß
%ver
3.3
%note
llmod3.hsp,scrsvr.hspðCN[h·é
(Windows9xÌÝpÂ\Å·)
%date
2009/08/01
%author
tom
%dll
llmod3
%url
http://www5b.biglobe.ne.jp/~diamond/hsp/hsp2file.htm
%ind... | zakki/openhsp | package/hsphelp/llmod3_scrsvr.hs | Haskell | bsd-3-clause | 1,685 |
{-# LANGUAGE NoImplicitPrelude #-}
module Control.Fay
(
ap
,foldM
,zipWithM
,zipWithM_
,replicateM
)
where
import FFI
import Prelude hiding (mapM)
ap :: Fay (a -> b) -> Fay a -> Fay b
ap f x = f >>= \f' -> x >>= \x' -> return (f' x')
foldM :: (a -> b -> Fay a) -> a... | crooney/cinder | src/Control/Fay.hs | Haskell | bsd-3-clause | 677 |
-- 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.Ordinal.IT.Tests
( tests ) where
import Prelude
import Data.String
import Test.Tasty
import D... | facebookincubator/duckling | tests/Duckling/Ordinal/IT/Tests.hs | Haskell | bsd-3-clause | 504 |
module HasTorrent
(
module HasTorrent.Types,
module HasTorrent.Types.TypesHelp,
module HasTorrent.Bencode,
module HasTorrent.Network.PeerProtocol,
module HasTorrent.Network.Communicate,
module HasTorrent.Tracker,
) where
import HasTorrent.Types
import HasTorrent.T... | vaishious/has-torrent | src/HasTorrent.hs | Haskell | bsd-3-clause | 464 |
{-# LANGUAGE GADTs, TypeFamilies, TypeOperators, EmptyDataDecls, FlexibleInstances, MultiParamTypeClasses, RankNTypes, QuasiQuotes, TemplateHaskell, ViewPatterns #-}
-------------------------------------------------------------------------
-- lambda lifting for the lambda calculus with top-level declarations
----------... | eddywestbrook/hobbits | archival/LambdaLiftingDB.hs | Haskell | bsd-3-clause | 14,594 |
module Print3Flipped where
myGreeting :: String
myGreeting = (++) "hello" " world"
hello::String
hello="hello"
world ::String
world = "world!"
main :: IO()
main = do
putStrLn myGreeting
putStrLn secondGreetiong
where secondGreetiong = (++) hello ((++) " " world)
| dhaneshkk/haskell-programming | print3Flippedl.hs | Haskell | bsd-3-clause | 298 |
{-
(c) The AQUA Project, Glasgow University, 1993-1998
\section[SimplUtils]{The simplifier utilities}
-}
{-# LANGUAGE CPP #-}
module SimplUtils (
-- Rebuilding
mkLam, mkCase, prepareAlts, tryEtaExpandRhs,
-- Inlining,
preInlineUnconditionally, postInlineUnconditionally,
activ... | tjakway/ghcjvm | compiler/simplCore/SimplUtils.hs | Haskell | bsd-3-clause | 79,475 |
module Q3Demo.Loader.Zip where
{-
Zip specification:
http://en.wikipedia.org/wiki/Zip_(file_format)
http://www.pkware.com/documents/casestudies/APPNOTE.TXT
-}
import Control.Applicative
import Data.Binary.Get
import Data.Bits
import Data.Word
import System.IO.MMap
import qualified Codec.Compression.Zlib.Raw ... | csabahruska/q3demo | src/Q3Demo/Loader/Zip.hs | Haskell | bsd-3-clause | 1,705 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE... | dorchard/camfort | src/Language/Fortran/Model/Op/Core/Match.hs | Haskell | apache-2.0 | 7,394 |
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE FlexibleContexts #-}
module Pontarius.E2E.Message where
import Control.Monad
import Control.Monad.Except
import Control.Monad.State.Strict
import qualified Crypto.Random as CRandom
import qualified Data.ByteString as BS
import Data.Wo... | Philonous/pontarius-xmpp-e2e | source/Pontarius/E2E/Message.hs | Haskell | apache-2.0 | 4,327 |
{-# LANGUAGE DeriveGeneric #-}
--------------------------------------------------------------------
-- |
-- Copyright : (c) Dan Doel 2014
-- License : BSD2
-- Maintainer: Dan Doel <dan.doel@gmail.com>
-- Stability : experimental
-- Portability: non-portable
-------------------------------------------------------... | PipocaQuemada/ermine | src/Ermine/Unification/Class.hs | Haskell | bsd-2-clause | 1,742 |
{-# LANGUAGE OverloadedStrings #-}
module Formalize.Html
( formHtml
, pdfHtml
) where
import Control.Monad.IO.Class (MonadIO)
import Data.Text.Lazy as LT (Text)
import Formalize.Types
import System.FilePath
import Text.Hastache
import Text... | Lepovirta/Crystallize | src/Formalize/Html.hs | Haskell | bsd-3-clause | 844 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeFamilyDependencies #-}
module Mimir.Types where
import Control.Lens.Lens (Lens')
import Control.Lens.TH
import Control.Monad.Except (ExceptT)
import Control.Monad.Reader (Reade... | ralphmorton/Mimir | src/Mimir/Types.hs | Haskell | bsd-3-clause | 2,550 |
module MediaWiki.API.Query.AllUsers.Import where
import MediaWiki.API.Types
import MediaWiki.API.Utils
import MediaWiki.API.Query.AllUsers
import Text.XML.Light.Types
import Control.Monad
import Data.Maybe
stringXml :: String -> Either (String,[{-Error msg-}String]) AllUsersResponse
stringXml s = parseDoc xml s
xm... | HyperGainZ/neobot | mediawiki/MediaWiki/API/Query/AllUsers/Import.hs | Haskell | bsd-3-clause | 1,042 |
{-# LANGUAGE QuasiQuotes #-}
module Main where
import Control.Monad
import System.Environment
import Language.C
import Language.C.System.GCC
import Text.Printf
import Text.PrettyPrint.HughesPJ
--import Here (here)
main = do
-- this is not the prettiest, but easiest solution
let depth = 2
putStrLn "#includ... | llelf/language-c | test/harness/bug31_pp_if_else/Test.hs | Haskell | bsd-3-clause | 2,083 |
{-# LANGUAGE DeriveDataTypeable, TypeFamilies, TemplateHaskell #-}
module Distribution.Server.Features.PackageCandidates.State where
import Distribution.Server.Features.PackageCandidates.Types
import Distribution.Server.Framework.MemSize
import qualified Distribution.Server.Packages.PackageIndex as PackageIndex
impo... | mpickering/hackage-server | Distribution/Server/Features/PackageCandidates/State.hs | Haskell | bsd-3-clause | 2,683 |
{- $Id: AFRPTestsCOC.hs,v 1.2 2003/11/10 21:28:58 antony Exp $
******************************************************************************
* A F R P *
* *
* Module: ... | meimisaki/Yampa | tests/AFRPTestsCOC.hs | Haskell | bsd-3-clause | 1,770 |
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you ma... | ajayanandgit/mbunit-v3 | tools/Thrift/src/lib/hs/src/Thrift.hs | Haskell | apache-2.0 | 3,468 |
{-# LANGUAGE CPP #-}
#ifdef TRUSTWORTHY
{-# LANGUAGE Trustworthy #-}
#endif
#ifndef MIN_VERSION_parallel
#define MIN_VERSION_parallel(x,y,z) (defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL > 700)
#endif
-----------------------------------------------------------------------------
-- |
-- Module : Control.Paral... | rpglover64/lens | src/Control/Parallel/Strategies/Lens.hs | Haskell | bsd-3-clause | 2,786 |
module Package06e where
import HsTypes
import UniqFM
| urbanslug/ghc | testsuite/tests/package/package06e.hs | Haskell | bsd-3-clause | 53 |
-- !!! Infix record constructor.
module ShouldCompile where
data Rec = (:<-:) { a :: Int, b :: Float }
| urbanslug/ghc | testsuite/tests/parser/should_compile/read010.hs | Haskell | bsd-3-clause | 104 |
{-# OPTIONS_GHC -funbox-strict-fields #-}
import Data.List
data Vec4 = Vec4 !Float !Float !Float !Float
main :: IO ()
main = print traceList
traceList = concatMap (\(x,y) -> let (r,g,b,a) = getPixel (x,y) in [r,g,b,a])
[(0,0)]
where
getPixel (x,y) = (red,green,blue,alpha)
where
Vec4 fr f... | sdiehl/ghc | testsuite/tests/codeGen/should_run/T1852.hs | Haskell | bsd-3-clause | 448 |
module Language.Go.Token where
import Language.Go.SrcLocation
data Token
= IdentifierToken { tokenLiteral :: !String, tokenSpan :: !SrcSpan }
-- Literals
| IntToken { tokenLiteral :: !String, tokenSpan :: !SrcSpan }
| FloatToken { tokenLiteral :: !String, tokenSpan :: !SrcSpan }
| ImaginaryToken { tokenLit... | codeq/language-go | src/Language/Go/Token.hs | Haskell | mit | 4,170 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE CPP #-}
module Network.HTTP.ReverseProxy.Rewrite
( ReverseProxyConfig (..)
, RewriteRule (..)
, RPEntry (..)
, simpleReverseProxy
)
where
import Control.Applicative
import Control.Exception (bracket)
import Dat... | snoyberg/keter | Network/HTTP/ReverseProxy/Rewrite.hs | Haskell | mit | 7,638 |
{-# LANGUAGE OverloadedStrings #-}
-- import Text.HTML.TagSoup
-- import Text.HTML.TagSoup.Tree
import GHC.Int
import Data.Maybe
import Control.Applicative ( (<$>) )
import Network.HTTP.Conduit
import Data.String.Conversions (cs)
import Data.Aeson
import Data.Aeson.Types
import Data.ByteString.Lazy as BL
import Data.... | begriffs/twittective | Main.hs | Haskell | mit | 855 |
-- |
module Language.Imperative.C where
import Language.Imperative
import qualified Language.C as C
type CType a = C.CDeclaration a
type CLit a = C.CConstant a
type CExpr e s a = Expr (CLit a) (CType a) e s a
type CStmt e s a = Statement (CLit a) (CType a) e s a
type CCase s a = Case (CLit a) s a
type CPat a = Patte... | sinelaw/imperative | src/Language/Imperative/C.hs | Haskell | mit | 1,197 |
module Main (main) where
-- Imports from 'tasty'
import Test.Tasty (defaultMain, testGroup)
-- Imports from 'jupyter'
import Jupyter.Test.Client (clientTests)
import Jupyter.Test.Install (installTests)
import Jupyter.Test.Kernel (kernelTests)
import Jupyter.Test.ZeroM... | gibiansky/jupyter-haskell | tests/Test.hs | Haskell | mit | 498 |
import Control.Arrow ((&&&))
import Data.List (transpose, sort, group)
colFreq :: Ord a => [a] -> [a]
colFreq = map snd . sort . count
where count = map (length &&& head) . group . sort
decode :: Ord a => ([a] -> a) -> [[a]] -> [a]
decode f = map (f . colFreq) . transpose
main :: IO ()
main = do
input <- lin... | mattvperry/AoC_2016 | day06/haskell/day6.hs | Haskell | mit | 399 |
module Language.Pal.Parser
( expr
) where
import Control.Applicative
import Text.Parsec.Char hiding (string)
import Text.Parsec.Combinator
import Text.Parsec.String
import Text.Parsec ((<?>))
import Language.Pal.Types
list :: Parser LValue
list = char '(' *> (List <$> (expr `sepBy` whitespaces)) <* char ')'
wh... | samstokes/pal | Language/Pal/Parser.hs | Haskell | mit | 1,103 |
-- Harshad or Niven numbers
-- http://www.codewars.com/kata/54a0689443ab7271a90000c6/
module Codewars.Kata.Harshad where
import Control.Arrow ((&&&))
import Data.Char (digitToInt)
import Data.Maybe (fromMaybe)
isValid :: Integer -> Bool
isValid = (==0) . uncurry mod . (id &&& fromIntegral . foldr ((+) . digitToInt)... | gafiatulin/codewars | src/6 kyu/Harshad.hs | Haskell | mit | 522 |
module Main where
import Control.Monad
import Control.Monad.Except
import Control.Monad.IO.Class (liftIO)
import Data.Char
import System.IO
import Language.Janus.AST
import Language.Janus.Interp
import Language.Janus.Parser
main :: IO ()... | mkaput/janus | repl/Main.hs | Haskell | mit | 1,531 |
{-# htermination (fromEnumRatio :: Ratio MyInt -> MyInt) #-}
import qualified Prelude
data MyBool = MyTrue | MyFalse
data List a = Cons a (List a) | Nil
data Tup2 a b = Tup2 a b ;
data Double = Double MyInt MyInt ;
data Float = Float MyInt MyInt ;
data Integer = Integer MyInt ;
data MyInt = Pos Nat | Neg Nat... | ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/fromEnum_2.hs | Haskell | mit | 3,161 |
module Main where
import Interpreter
import PowAST
import qualified Parse as P
import qualified Data.Map as M
import Text.ParserCombinators.Parsec (parse)
main :: IO ()
main = runMoreCode M.empty M.empty
runMoreCode :: SymTab -> FunTab -> IO ()
runMoreCode vtab ftab = do
putStr "> "
input <- getLine
let ast = ... | rloewe/petulant-octo-wallhack | Repl.hs | Haskell | mit | 563 |
answer = length $ combinations sums
coins = [200,100,50,20,10,5,2,1]
sums = [200,0,0,0,0,0,0,0]
combinations :: [Int] -> [[Int]]
combinations ts
| next ts == [] = [ts]
| otherwise = ts : combinations(next ts)
next :: [Int] -> [Int]
next ts
| ts!!6>0 = fst' 6 ++ [ (ts!!6)-2, (ts!!... | yuto-matsum/contest-util-hs | src/Euler/031.hs | Haskell | mit | 3,090 |
module Options (
extractOptions,
isHelp,
isVerbose,
imgOptions,
eqInlineOptions,
fontSize,
outputFile,
packages,
showHelp
) where
import System.Console.GetOpt
import qualified Data.Text as T (pack, unpack, split)
data Flag = Help | Verbose | Package String | FontSize String | Output String... | dino-r/TexErupter | src/Options.hs | Haskell | mit | 2,863 |
import Network.HTTP.Server
import Network.HTTP.Server.Logger
import Network.HTTP.Server.HtmlForm as Form
import Network.URL as URL
import Text.JSON
import Text.JSON.String(runGetJSON)
import Text.XHtml
import Codec.Binary.UTF8.String
import Control.Exception(try,SomeException)
import System.FilePath
import Data.List(is... | GaloisInc/http-server | example/SimpleWeb.hs | Haskell | mit | 3,778 |
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE FlexibleContexts #-}
{- |
Module : Control.Lens.SemiIso
Description : Semi-isomorphisms.
Copyright : (c) Paweł Nowak
License : MIT
Maintain... | pawel-n/semi-iso | Control/Lens/SemiIso.hs | Haskell | mit | 15,262 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
-- Copyright (C) 2012 John Millikin <jmillikin@gmail.com>
--
-- See license.txt for details
module OptionsTests.StringParsing
( suite_StringParsing
) where
import Control.Applicative
import Test.Chell
import Options
data StringOpt... | jmillikin/haskell-options | tests/OptionsTests/StringParsing.hs | Haskell | mit | 1,981 |
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module AEAD.XChaCha20Poly1305Properties (
testAEADXChaCha20
) where
import Util
import Crypto.Saltine.Core.AEAD.XChaCha20Poly1305
import Crypto.Saltine.Class (decode)
import Crypto.Saltine.Internal.AEA... | tel/saltine | tests/AEAD/XChaCha20Poly1305Properties.hs | Haskell | mit | 4,999 |
import Stomp
import System
main = do
args <- getArgs
client<- connect "localhost" 61613 []
send client (args !! 0) [] (args !! 1)
| akisystems/stomp-hs | src/Sender.hs | Haskell | mit | 144 |
module NestedRoots.A338271Spec (main, spec) where
import Test.Hspec
import NestedRoots.A338271 (a338271)
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "A338271" $
it "correctly computes the first 20 elements" $
map a338271 [1..20] `shouldBe` expectedValue where
expectedValue = [1,0,0,2,0,2,... | peterokagey/haskellOEIS | test/NestedRoots/A338271Spec.hs | Haskell | apache-2.0 | 352 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleInstances #-}
import Data.Maybe (maybe)
import Control.Monad (liftM)
newtype Reader e a = Reader { runReader :: e -> a }
instance Functor (Reader e) where
fmap f (Reader r) = Reader $ \e -> f (r e)
instance Applicat... | egaburov/funstuff | Haskell/monads/readm.hs | Haskell | apache-2.0 | 2,794 |
-- Demonstrates of a possible solution to expression problem in Haskell.
module Main where
import Prelude hiding (print)
-- Classes
class Document a where
load :: a -> IO ()
save :: a -> IO ()
class Printable a where
print :: a -> IO ()
-- Text Document
data TextDocument = TextDocument String
-- D... | rizo/lambda-lab | expression-problem/haskell/expression-problem-1.hs | Haskell | apache-2.0 | 1,307 |
module PopVox
( module X
) where
import PopVox.OpenSecrets
import PopVox.OpenSecrets.Output
import PopVox.OpenSecrets.Types
import PopVox.OpenSecrets.Utils
import PopVox.Types
import qualified PopVox.OpenSecrets as X
import qualified PopVox.OpenSecre... | erochest/popvox-scrape | src/PopVox.hs | Haskell | apache-2.0 | 480 |
{-# LANGUAGE OverloadedStrings #-}
module Yesod.Session.Redis (
localRedisSessionBackend,
redisSessionBackend
) where
import qualified Web.RedisSession as R
import Yesod.Core
import qualified Network.Wai as W
import Web.Cookie
import Control.Monad.Trans (liftIO)
import Data.Maybe (fromMaybe)
import Data.Time (UTC... | scan/redissession | Yesod/Session/Redis.hs | Haskell | bsd-2-clause | 2,239 |
module HEP.Physics.MSSM.Model.Common where
newtype Sign = Sign Bool
deriving (Show,Eq,Ord)
-- |
sgnplus :: Sign
sgnplus = Sign True
-- |
sgnminus :: Sign
sgnminus = Sign False
-- |
toInt :: Sign -> Int
toInt (Sign True) = 1
toInt (Sign False) = -1
-- |
fromInt :: Int -> Sign
fromInt i = Sign (i >= 0... | wavewave/MSSMType | src/HEP/Physics/MSSM/Model/Common.hs | Haskell | bsd-2-clause | 323 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
module Test.ZM.ADT.LeastSignificantFirst.K20ffacc8f8c9 (LeastSignificantFirst(..)) where
import qualified Prelude(Eq,Ord,Show)
import qualified GHC.Generics
import qualified Flat
import qualified Data.Model
newtype LeastSignificantFirst a = LeastSignifi... | tittoassini/typed | test/Test/ZM/ADT/LeastSignificantFirst/K20ffacc8f8c9.hs | Haskell | bsd-3-clause | 496 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UndecidableInstances #-}
module FPNLA.Operations.BLAS.Strategies.GEMV (
) where
import FPNLA.Matrix (asColumn_vm, toCols_vm)
import FPNLA.Operations.BL... | mauroblanco/fpnla-examples | src/FPNLA/Operations/BLAS/Strategies/GEMV.hs | Haskell | bsd-3-clause | 873 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
module Web.ChatWork.Endpoints.My (
statusEndpoint
, MyStatus(..)
, Task(..)
, tasksEndpoint
) where
import Data.Aeson
import Data.ByteString.Char8
import GHC.Generics
import Web.ChatWork.Endpoints.Base
import Web.ChatWork.Internal as I
impo... | eiel/haskell-chatwork | src/Web/ChatWork/Endpoints/My.hs | Haskell | bsd-3-clause | 1,452 |
module Examples where
import Lang.Lam.Syntax
import FP
import qualified FP.Pretty as P
import qualified Lang.Lam.Analyses as A
import Lang.Lam.Passes.B_CPSConvert
formatResults :: Doc -> Doc
formatResults = localSetL P.maxColumnWidthL 120 . localSetL P.maxRibbonWidthL 120
doConfig :: Exp -> [String] -> [String] -> [... | davdar/quals | src/Examples.hs | Haskell | bsd-3-clause | 1,966 |
{-# LANGUAGE CPP #-}
-------------------------------------------------------------------------------
-- |
-- Copyright : (c) 2010 Eugene Kirpichov, Dmitry Astapov
-- License : BSD3
--
-- Maintainer : Eugene Kirpichov <ekirpichov@gmail.com>,
-- Dmitry Astapov <dastapov@... | jkff/greg | greg-clients/haskell/System/Log/Greg.hs | Haskell | bsd-3-clause | 11,509 |
module Mask where
import Data.Char (toUpper)
import Data.Maybe (catMaybes, isJust)
import Data.List
newtype Mask = Mask [Maybe Char]
deriving (Eq, Show)
parseMask :: String -> Maybe Mask
parseMask = fmap Mask . mapM (aux . toUpper)
where
aux '.' = return Nothing
aux c | c `elem` alph... | glguy/vty-hangman-helper | Mask.hs | Haskell | bsd-3-clause | 1,697 |
module Basil.Database.InMemory ( module Basil.Database.InMemory.Interface,
module Basil.Database.InMemory.Cache,
) where
import Basil.Database.InMemory.Cache
import Basil.Database.InMemory.Interface
| chriseidhof/Basil | src/Basil/Database/InMemory.hs | Haskell | bsd-3-clause | 266 |
module GrammarLexer
( GrammarLexeme(..)
, runLexer
) where
import Data.Char
import Data.Monoid ((<>))
import Control.Applicative ((<*>), (<*), (*>))
import Text.Parsec.String (Parser)
import Text.Parsec.Char
import Text.Parsec.Prim
import Text.Parsec.Combinator
import Text.Parsec.Error (ParseError)
import ... | flyingleafe/parser-gen | src/GrammarLexer.hs | Haskell | bsd-3-clause | 4,002 |
module TestTypechecker where
import Test.HUnit
import Parser
import Typechecker
intCheck :: Assertion
intCheck = parseAndTypecheck "60" "int"
if0Check :: Assertion
if0Check = parseAndTypecheck "if0 5 then <> else <>" "unit"
absCheck :: Assertion
absCheck = parseAndTypecheck "func [] (x:int) . x" "forall [] (int) -... | phillipm/mlish-to-llvm | test/TestTypechecker.hs | Haskell | bsd-3-clause | 1,374 |
module Settings.Exception.Prettify.JSONException (
pJSONException
) where
import Control.Exception
import Network.HTTP.Simple
import Settings.Exception.Prettify.HttpException (getReqStringHost)
pJSONException :: SomeException -> Maybe String
pJSONException ex = extractor <$> fromExc... | Evan-Zhao/FastCanvas | src/Settings/Exception/Prettify/JSONException.hs | Haskell | bsd-3-clause | 682 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.