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
module CFDI.Types.ProductDescription where import CFDI.Chainable import CFDI.Types.Type import Data.Text (Text, pack, unpack) import Text.Regex (mkRegex) import Text.Regex.Posix (matchTest) newtype ProductDescription = ProductDescription Text deriving (Eq, Show) instance Chainable ProductDescription whe...
yusent/cfdis
src/CFDI/Types/ProductDescription.hs
Haskell
mit
667
{-# LANGUAGE PackageImports, RecordWildCards #-} module GameState where import "GLFW-b" Graphics.UI.GLFW as GLFW import Graphics.Gloss.Rendering import Graphics.Gloss.Data.Color import Graphics.Gloss.Data.Picture import Control.Applicative import qualified Data.List as L import Math.Geometry.Grid.Hexagonal import Mat...
joom/civ
src/GameState.hs
Haskell
mit
5,819
-- These are the tests for our api. The only real interesting part is the -- 'main' function, were we specific that the test database is different -- from the production database. {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# ...
cdepillabout/testing-code-that-accesses-db-in-haskell
with-db/testing-db/test/Test.hs
Haskell
apache-2.0
4,579
{-# LANGUAGE PackageImports #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE NoImplicitPrelude #-} {- Copyright 2020 The CodeWorld Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this f...
google/codeworld
codeworld-base/src/Internal/Color.hs
Haskell
apache-2.0
7,724
{-# LANGUAGE MultiParamTypeClasses #-} -- |Collections which support efficient bulk insertion. module Data.Collections.BulkInsertable where import qualified Data.Set as S -- |The class of data structures to which can be appended. class BulkInsertable a b where bulkInsert :: a -> b -> b instance Ord a => BulkInse...
jtapolczai/Hephaestos
Data/Collections/BulkInsertable.hs
Haskell
apache-2.0
541
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} #include "version-compatibility-macros.h" -- | Common symbols composed out of the ASCII subset of Unicode. For non-ASCII -- symbols, see "Prettyprinter.Symbols.Unicode". module Prettyprinter.Symbols.Ascii where import Prettyprinter.Internal -...
quchen/prettyprinter
prettyprinter/src/Prettyprinter/Symbols/Ascii.hs
Haskell
bsd-2-clause
2,232
{- This module is used to preprocess the AST before we - actually use it -} module DuckTest.AST.Preprocess (preprocess) where import DuckTest.Internal.Common import DuckTest.AST.Util import DuckTest.AST.BinaryOperators import qualified Data.Map as Map dunderFunctions :: Map String String dunderFunctions = Map.from...
jrahm/DuckTest
src/DuckTest/AST/Preprocess.hs
Haskell
bsd-2-clause
1,593
module Kis ( KisRequest(..) , KisConfig(..) , KisClient , Kis(..) , KisException(..) , KisClock(..) , KisRead(..) , KisWrite(..) , NotificationHandler(..) , SqliteBackendType(..) , constClock , realTimeClock , runClient , runSingleClientSqlite , runKis , w...
lslah/kis-proto
src/Kis.hs
Haskell
bsd-3-clause
983
-- 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.AmountOfMon...
facebookincubator/duckling
Duckling/AmountOfMoney/EN/TT/Rules.hs
Haskell
bsd-3-clause
1,819
-- | -- Module: Control.Wire.Event -- Copyright: (c) 2013 Ertugrul Soeylemez -- License: BSD3 -- Maintainer: Ertugrul Soeylemez <es@ertes.de> module Control.Wire.Event ( -- * Events Event, -- * Time-based at, never, now, periodic, periodicList, -- * Signal ...
Teaspot-Studio/netwire
Control/Wire/Event.hs
Haskell
bsd-3-clause
7,886
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE Rank2Types #-} -----------------...
andrewthad/vinyl-vectors
src/Data/Vector/Vinyl/Default/Empty/Monomorphic.hs
Haskell
bsd-3-clause
48,286
{-# LANGUAGE BangPatterns #-} module Main where import Control.Arrow as A import GalFld.GalFld import GalFld.More.SpecialPolys {-import System.Random-} import Data.List import Debug.Trace import Data.Maybe import GalFld.Core.Polynomials.FFTTuple {-import GalFld.Core.Polynomials.Conway-} {---------------------------...
maximilianhuber/softwareProjekt
profiling/AlgProfiling.hs
Haskell
bsd-3-clause
5,861
module Internal.X86.Default where import Foreign import Foreign.C.Types import Data.List (dropWhileEnd) import Hapstone.Internal.Util import Hapstone.Internal.X86 import Test.QuickCheck import Test.QuickCheck.Instances -- generators for our datatypes instance Arbitrary X86Reg where arbitrary = elements [minBo...
ibabushkin/hapstone
test/Internal/X86/Default.hs
Haskell
bsd-3-clause
1,915
{-# language CPP #-} {-# language MultiParamTypeClasses #-} #if __GLASGOW_HASKELL__ >= 800 {-# options_ghc -Wno-redundant-constraints #-} #endif module OpenCV.Internal.ImgProc.MiscImgTransform.ColorCodes where import "base" Data.Int ( Int32 ) import "base" Data.Proxy ( Proxy(..) ) import "base" Data.Word import "bas...
Cortlandd/haskell-opencv
src/OpenCV/Internal/ImgProc/MiscImgTransform/ColorCodes.hs
Haskell
bsd-3-clause
43,738
import Control.Monad import Data.MessagePack {- main = do sb <- newSimpleBuffer pc <- newPacker sb pack pc [(1,2),(2,3),(3::Int,4::Int)] pack pc [4,5,6::Int] pack pc "hoge" bs <- simpleBufferData sb print bs up <- newUnpacker defaultInitialBufferSize unpackerFeed up bs let f = do ...
tanakh/hsmsgpack
test/Test.hs
Haskell
bsd-3-clause
587
{-| Copyright : (c) Dave Laing, 2017 License : BSD3 Maintainer : dave.laing.80@gmail.com Stability : experimental Portability : non-portable -} module Ast.Error.Common ( module X ) where import Ast.Error.Common.Kind as X import Ast.Error.Common.Type as X
dalaing/type-systems
src/Ast/Error/Common.hs
Haskell
bsd-3-clause
271
{-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE EmptyCase #-} module Language.BCoPL.TypeLevel.MetaTheory.CompareNat where import Language.BCoPL.TypeLevel.Peano import Language.BCoPL.TypeLevel.CompareNat -- | 定理 2.11 (CompareNat1: 0 < 1+a) zeroLtSucc1 :: Nat' n -> LessThan1 Z...
nobsun/hs-bcopl
src/Language/BCoPL/TypeLevel/MetaTheory/CompareNat.hs
Haskell
bsd-3-clause
3,794
module Web.Plurk.Types ( Return (..) , Message (..) , User (..) , Privacy (..) , Gender (..) , Relationship (..) , Qualifier (..) , ReadStat (..) ...
crabtw/hsplurk
Web/Plurk/Types.hs
Haskell
bsd-3-clause
15,627
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} --------------------------------------------------------------- -- | -- Module : Data.Minecraft.Release17.Protocol -- Copyright : (c) 2016 Mi...
oldmanmike/hs-minecraft-protocol
src/Data/Minecraft/Release17/Protocol.hs
Haskell
bsd-3-clause
41,010
module Queue ( Queue , queue , mqueue, push, pop, popWhile, runFold, size, ) where import Data.Foldable -- A double ended queue which keeps track of a front and a back, as well as -- an accumulation function. Inspired by https://people.cs.uct.ac.za/~ksmith/articles/sliding_window_minimum.html#sliding-...
charles-cooper/hroll
src/Queue.hs
Haskell
bsd-3-clause
4,255
module GPipeFPSMaterial where import Graphics.GPipe import qualified Data.ByteString.Char8 as SB identityLight :: Float identityLight = 1 data Entity = Entity { eAmbientLight :: Vec4 (Vertex Float) , eDirectedLight :: Vec4 (Vertex Float) , eLightDir :: Vec3 (Vertex Float) , eShader...
csabahruska/GFXDemo
GPipeFPSMaterial.hs
Haskell
bsd-3-clause
3,629
module UI.Geometry where import Control.Applicative (liftA, liftA2) import Data.Functor.Classes import Data.Functor.Listable import Data.Semigroup data Rect a = Rect { origin :: !(Point a), size :: !(Size a) } deriving (Eq, Foldable, Functor, Ord, Traversable) containsPoint :: Real a => Rect a -> Point a -> Bool c...
robrix/ui-effects
src/UI/Geometry.hs
Haskell
bsd-3-clause
2,792
-- | Half-memory implementation of symmetric matrices with -- null-diagonal. module Math.VectorSpaces.DistanceMatrix ( DistanceMatrix, RealDistanceMatrix, BooleanDistanceMatrix, generate, (?), (!), Math.VectorSpaces.DistanceMatrix.map ...
michiexile/hplex
pershom/src/Math/VectorSpaces/DistanceMatrix.hs
Haskell
bsd-3-clause
1,675
module Network.MtGoxAPI.DepthStore.Monitor ( monitorDepth ) where import Control.Applicative import Control.Concurrent import Control.Monad import Data.Maybe import Text.Printf import Network.MtGoxAPI.DepthStore monitorDepth :: DepthStoreHandle -> IO () monitorDepth handle = forever $ do putStrLn "" ...
javgh/mtgoxapi
Network/MtGoxAPI/DepthStore/Monitor.hs
Haskell
bsd-3-clause
2,311
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeOperators #-} module Serv.Server.Core.Runtime ( runCore ) where import Control.Lens import Control.Monad.Except import Control.Monad.Reader ...
orangefiredragon/bear
src/Serv/Server/Core/Runtime.hs
Haskell
bsd-3-clause
2,550
{-# LINE 1 "GHC.Conc.Signal.hs" #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} module GHC.Conc.Signal ( Signal , HandlerFun , setHandler , runHandlers , runHandlersPtr ) where import Control.Concurrent.MVar (MVar, newMVar, withMVar) import Data.Dyna...
phischu/fragnix
builtins/base/GHC.Conc.Signal.hs
Haskell
bsd-3-clause
3,458
module Main where import System.Environment import Arion.Runner main :: IO () main = getArgs >>= run
saturday06/arion
src/Main.hs
Haskell
mit
103
{-# OPTIONS_GHC -fno-warn-type-defaults #-} import Data.Foldable (for_) import Test.Hspec (Spec, describe, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Triangle ( TriangleType ( Equilateral , Illegal , Isosceles ...
xTVaser/Exercism-Solutions
haskell/triangle/test/Tests.hs
Haskell
mit
2,496
module Main where import HTrees import Control.Monad.IO.Class import Data.CSV.Conduit import Data.List import qualified Data.Map.Lazy as Map import Data.Maybe import Data.Vector (Vector, fromList, toList, (!)) import System.Environment (getArgs) ...
mreid/HTrees
src/run.hs
Haskell
mit
2,545
{-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE CPP #-} module Foundation.Collection.Copy ( Copy(..) ) where import GHC.ST (runST) import Basement.Compat.Base ((>>=)) import Basement.Nat import Basement.Types.OffsetSize import qualified Basement.Block as BLK import q...
vincenthz/hs-foundation
foundation/Foundation/Collection/Copy.hs
Haskell
bsd-3-clause
1,146
{-# OPTIONS_GHC -Wall #-} module Optimize.Case (optimize) where import Control.Arrow (second) import qualified Data.Map as Map import Data.Map ((!)) import qualified Data.Maybe as Maybe import qualified AST.Expression.Optimized as Opt import qualified AST.Pattern as P import qualified Optimize.DecisionTree as DT -...
mgold/Elm
src/Optimize/Case.hs
Haskell
bsd-3-clause
4,385
----------------------------------------------------------------------------- -- | -- Module : Data.Ratio -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability : stable -- Portability : po...
alekar/hugs
packages/base/Data/Ratio.hs
Haskell
bsd-3-clause
3,206
{-# LANGUAGE BangPatterns, CPP, GADTs #-} module MkGraph ( CmmAGraph, CmmAGraphScoped, CgStmt(..) , (<*>), catAGraphs , mkLabel, mkMiddle, mkLast, outOfLine , lgraphOfAGraph, labelAGraph , stackStubExpr , mkNop, mkAssign, mkStore , mkUnsafeCall, mkFinalCall, mkCallReturnsTo , mkJumpReturnsTo , mkJum...
shlevy/ghc
compiler/cmm/MkGraph.hs
Haskell
bsd-3-clause
14,778
-- | A CPS IR. module Ivory.Compile.ACL2.CPS ( Proc (..) , Value (..) , Literal (..) , Cont (..) , Var , variables , contFreeVars , explicitStack , replaceCont , commonSubExprElim , removeAsserts , removeNullEffect ) where import Data.List import Text.Printf impor...
GaloisInc/ivory-backend-acl2
src/Ivory/Compile/ACL2/CPS.hs
Haskell
bsd-3-clause
10,661
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} -- | A wrapper around hoogle. module Stack.Hoogle ( hoogleCmd ) where import Stack.Prelude import qualified Data.ByteString.Lazy.Char8 as BL8 import Data.Char (isSpace) import qualifi...
juhp/stack
src/Stack/Hoogle.hs
Haskell
bsd-3-clause
8,978
{-# LANGUAGE DataKinds, TypeOperators, TypeFamilies #-} {-# OPTIONS_GHC -fwarn-redundant-constraints #-} module TcTypeNatSimple where import GHC.TypeLits import Data.Proxy type family SomeFun (n :: Nat) -- See the ticket; whether this succeeds or fails is distinctly random -- upon creation, commit f861fc6ad8e5504a4...
sdiehl/ghc
testsuite/tests/typecheck/should_compile/T9708.hs
Haskell
bsd-3-clause
1,047
{-# LANGUAGE DeriveDataTypeable #-} module HsTypeStruct where import Data.Generics -------- Types ----------------------------------------------------------------- data TI i t = HsTyFun t t -- | HsTyTuple [t] | HsTyApp t t | HsTyVar i | HsTyCon i | HsTyForall [i] [t] t -- forall is . Ps => t ...
kmate/HaRe
old/tools/base/AST/HsTypeStruct.hs
Haskell
bsd-3-clause
369
{-# OPTIONS_GHC -cpp #-} {-# OPTIONS -fglasgow-exts #-} {-# LANGUAGE MultiParamTypeClasses, OverlappingInstances, UndecidableInstances, FunctionalDependencies, NoMonomorphismRestriction #-} {-+ Type environments. For efficiency, a type environment is represented as a pair of an environment and the set of (nongeneric) ...
kmate/HaRe
old/tools/base/TI/TiTEnv.hs
Haskell
bsd-3-clause
1,402
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- This is a non-exposed internal module. -- -- This code contains utility function and data structures that are used -- to improve the efficiency of several instances in the Da...
ezyang/ghc
libraries/base/Data/Functor/Utils.hs
Haskell
bsd-3-clause
3,943
module D2 where y = 0 f z x = x + z f_gen = (y + 1) sumFun xs = sum $ (map (f (y + 1)) xs)
kmate/HaRe
old/testing/generaliseDef/D2_AstOut.hs
Haskell
bsd-3-clause
98
{-# LANGUAGE RecordWildCards #-} module T9437 where data Foo = Foo { x :: Int } test :: Foo -> Foo test foo = foo { .. }
ezyang/ghc
testsuite/tests/rename/should_fail/T9437.hs
Haskell
bsd-3-clause
124
-- Area of a Circle -- http://www.codewars.com/kata/537baa6f8f4b300b5900106c module Circle where circleArea :: Double -> Maybe Double circleArea r | r > 0 = Just( pi * r^2) | otherwise = Nothing
gafiatulin/codewars
src/7 kyu/Circle.hs
Haskell
mit
210
module Main where import System.Environment(getArgs) import Scheme(eval) -- The driver function for the executable parser that simply runs the parser on -- the first command-line argument and prints the resulting error or Expr. main :: IO () main = do args <- getArgs case eval (head args) of Left err -> p...
mjdwitt/a-scheme
src/Main.hs
Haskell
mit
356
module Main where addOne :: Num a => a -> a addOne a = a + 1 addTwo :: Num a => a -> a addTwo a = a + 2 result :: Num b => [b] -> [b] result xs = map addOne xs main :: IO () main = do let ans = result [10] print ans
calvinchengx/learnhaskell
functors/functors.hs
Haskell
mit
233
import Control.Monad (replicateM, fmap, forM_) import Control.Parallel import Data.IORef import Data.List ((\\)) import Graphics.UI.GLUT import System.Random (getStdRandom, randomR, setStdGen, mkStdGen, getStdGen) import System.Random.Shuffle (shuffle') import qualified Data.Map as Map (findMax, f...
7lb/tsp-haskell
nn.hs
Haskell
mit
5,837
----------------------------------------------------------------------------- -- -- Module : Parcial2.App -- Copyright : -- License : MIT -- -- Maintainer : - -- Stability : -- Portability : -- -- | -- module Parcial2.App where import Data.Maybe import Data.Typeable import GeneticAlgorithm import P...
fehu/itesm-ga
src/Parcial2/App.hs
Haskell
mit
6,832
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, InstanceSigs #-} module CompilerUtility (compilerSettings) where import Control.Applicative import Data.List.Utils import System.FilePath.Posix import System.IO import Data.ConfigFile import CompilationUtility import qualifi...
Prinhotels/goog-closure
src/CompilerUtility.hs
Haskell
mit
3,421
{- DOC: Paste all the following commented lines in the file importing this module (don’t forget to update constant ‘filename’). import qualified SRC.Log as Log -- write code here -- boilerplate for logging filename = "-.hs" fatal :: Show a => String -> a -> b fatal msg line = Log.reportFatal filename msg line fix...
Fornost461/drafts-and-stuff
Haskell/samples/Template/SRC/Log.hs
Haskell
cc0-1.0
716
{-# LANGUAGE OverloadedStrings #-} module Main where import Web.Scotty import Data.Monoid (mconcat) import Data.Time.Clock -- monoid main = scotty 3000 $ do get "/:word" $ do beam <- param "word" html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"] -- mconcat = foldr mappend mempty -- functor offsetCurre...
prt2121/haskell-practice
ch6-11-17-25/src/Main.hs
Haskell
apache-2.0
445
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Openshift.V1.ImageStreamTag where import GHC.Generics import Data.Text import Kubernetes.V1.ObjectMeta import Openshift.V1.Image import qualifi...
minhdoboi/deprecated-openshift-haskell-api
openshift/lib/Openshift/V1/ImageStreamTag.hs
Haskell
apache-2.0
1,216
{-# LANGUAGE OverloadedStrings #-} -- Copyright 2014 (c) Diego Souza <dsouza@c0d3.xxx> -- -- 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....
locaweb/leela
src/warpdrive/src/Leela/Data/EventTree.hs
Haskell
apache-2.0
3,232
module External.A143481Spec (main, spec) where import Test.Hspec import External.A143481 (a143481) main :: IO () main = hspec spec spec :: Spec spec = describe "A143481" $ it "correctly computes the first 20 elements" $ take 20 (map a143481 [1..]) `shouldBe` expectedValue where expectedValue = [1,2,6,8,20...
peterokagey/haskellOEIS
test/External/A143481Spec.hs
Haskell
apache-2.0
377
{-| Module describing an instance. The instance data type holds very few fields, the algorithm intelligence is in the "Node" and "Cluster" modules. -} {- 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 ...
ganeti-github-testing/ganeti-test-1
src/Ganeti/HTools/Instance.hs
Haskell
bsd-2-clause
13,980
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} -- | Observation schema blocks for Nerf. module NLP.Nerf.Schema ( -- * Types Ox , Schema , void , sequenceS_ -- * Usage , schematize -- ** Configuration , Body (..) , Entry , entry , entryWith , SchemaConf (..) , nullConf , defaultConf , fromCon...
kawu/nerf
src/NLP/Nerf/Schema.hs
Haskell
bsd-2-clause
11,056
module Utilities.Bits where import Emulator.Types import Data.Bits import Data.Int -- This is what the halfWordExtend function is doing but we've opted for -- the fromIntegral approach which has a chance to be faster (untested) --halfWordExtend :: HalfWord -> MWord --halfWordExtend h = val .|. orVal -- where -- ...
intolerable/GroupProject
src/Utilities/Bits.hs
Haskell
bsd-2-clause
1,095
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE ForeignFunctionInterface #-} module Main where -- External dependencies imports -- import CATerms -- import Filesystem hiding (writeFile, readFile, withFile, openFile) -- import Language.Java.Pretty -- import Language.Jav...
dagit/edit-patterns
Main.hs
Haskell
bsd-3-clause
37,050
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} ----------------------------------------------------------------------------- -- | -- Module : Text.CSL.Input.Bibtex -- Copyright : (c) John MacFarlane -- Licen...
adunning/pandoc-citeproc
src/Text/CSL/Input/Bibtex.hs
Haskell
bsd-3-clause
66,320
module Noobing.Experimenting.IO ( hello ) where hello :: IO () hello = do putStrLn "hello!"
markmq/Noobing
src/Noobing/Experimenting/IO.hs
Haskell
bsd-3-clause
95
{-# LANGUAGE TupleSections #-} module Day17 where -- Improvements to Day12 import Control.Monad.Reader import Control.Monad.Trans.Either import qualified Data.Map as Map data Type = Function Type Type | RecordT [(String, Type)] | VariantT [(String, Type)] deriving (Eq, Show) data CheckTerm -- neither a ...
joelburget/daily-typecheckers
src/Day17.hs
Haskell
bsd-3-clause
7,281
{-# LANGUAGE GADTs #-} module Term where data Term t where Zero :: Term Int Succ :: Term Int -> Term Int Pred :: Term Int -> Term Int IsZero :: Term Int -> Term Bool If :: Term Bool -> Term a -> Term a -> Term a eval :: Term t -> t eval Zero = 0 eval (Succ e) = succ (eval e) eval (Pred e) ...
maoe/fop
12-Fun-with-Phantom-Types/Term.hs
Haskell
bsd-3-clause
478
{-# OPTIONS_GHC -Wall #-} module System.Console.ShSh.Builtins.Cmp ( cmp ) where import System.Console.ShSh.Builtins.Args ( withArgs, flagOn, flag ) import System.Console.ShSh.Builtins.Util ( readFileOrStdin ) import System.Console.ShSh.Shell ( Shell ) import System.Exit ( ExitCode(..) ) {-# NOINLINE cmp #-} cmp :: [...
shicks/shsh
System/Console/ShSh/Builtins/Cmp.hs
Haskell
bsd-3-clause
1,457
{-# LANGUAGE QuasiQuotes #-} module LLVM.General.Quote.Test.DataLayout where import Test.Tasty import Test.Tasty.HUnit import Test.HUnit import Data.Maybe import qualified Data.Set as Set import qualified Data.Map as Map import LLVM.General.Quote.LLVM import LLVM.General.AST import LLVM.General.AST.DataLayout impo...
tvh/llvm-general-quote
test/LLVM/General/Quote/Test/DataLayout.hs
Haskell
bsd-3-clause
3,333
{-| Module : Database.Relational.Project Description : Definition of PROJECT and friends. Copyright : (c) Alexander Vieth, 2015 Licence : BSD3 Maintainer : aovieth@gmail.com Stability : experimental Portability : non-portable (GHC only) -} {-# LANGUAGE AutoDeriveTypeable #-} {-# LANGUAGE TypeFamilies #-}...
avieth/Relational
Database/Relational/Project.hs
Haskell
bsd-3-clause
1,841
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE OverloadedStrings #-} module Develop.Generate.Index ( toHtml , getProject , moveToRoot ) where import Control.Monad (filterM) import Data.Aeson ((.=)) import qualified Data.Aeson as Json import qualified Data.ByteString.Lazy.UTF8 as BSU8 import qualified Data.List as Li...
evancz/cli
src/Develop/Generate/Index.hs
Haskell
bsd-3-clause
4,285
-- | Internal array type used by the B-tree types {-# LANGUAGE BangPatterns, CPP, MagicHash, Rank2Types, UnboxedTuples #-} module Data.BTree.Array ( -- * Types Array , MArray -- * Creating arrays , run , new , unsafeWrite , unsafeCopy -- * Inspecting arrays , unsafeIn...
jaspervdj/b-tree
src/Data/BTree/Array.hs
Haskell
bsd-3-clause
2,991
{-# LANGUAGE RankNTypes, OverloadedStrings #-} module Saturnin.Types ( MachineDescription , Hostname , BuildRequest (..) , JobRequest (..) , TestType (..) , GitSource (..) , YBServer , YBServerState (..) , YBSSharedState , fst3 , TestResult (..) , anyEither , isPassed...
yaccz/saturnin
library/Saturnin/Types.hs
Haskell
bsd-3-clause
2,738
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} import Data.String (fromString) import System.Environment (getArgs) import qualified Network.Wai.Handler.Warp as Warp import qualified Network.Wai as Wai import qualified Network.HTTP...
mitsuji/exp-CloudHaskell
app/WaiChat.hs
Haskell
bsd-3-clause
5,093
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} import Language.JsonGrammar import Types import Prelude hiding (id, (.)) import Control.Category (Category(..)) import Data.Aeson.Types (Value, parseMaybe) import D...
MedeaMelana/JsonGrammar2
tests/Tests.hs
Haskell
bsd-3-clause
2,169
module Control.Monad.Syntax.Three where (===<<) :: Monad m => (a -> b -> c -> m d) -> m a -> b -> c -> m d (===<<) mf inp b c = inp >>= (\a -> mf a b c) infixl 1 ===<< (=.=<<) :: Monad m => (a -> b -> c -> m d) -> m b -> a -> c -> m d (=.=<<) mf inp a c = inp >>...
athanclark/composition-extra
src/Control/Monad/Syntax/Three.hs
Haskell
bsd-3-clause
502
{-# LANGUAGE FlexibleContexts, UndecidableInstances, TypeSynonymInstances, FlexibleInstances, RankNTypes, TupleSections #-} -- Ref.) https://stackoverflow.com/questions/13352205/what-are-free-monads/13352580 module Free where import Control.Arrow import Control.Monad.State data Free f a = Pure a | Roll ...
cutsea110/aop
src/Free.hs
Haskell
bsd-3-clause
6,957
{-# LANGUAGE TemplateHaskell, OverloadedStrings #-} module Monto.RegisterServiceRequest where import Data.Aeson.TH import Data.Aeson (Value) import Data.Vector (Vector) import qualified Data.Vector as V import Data.Text (Text) import qualified Data.Text as T import Dat...
wpmp/monto-broker
src/Monto/RegisterServiceRequest.hs
Haskell
bsd-3-clause
1,180
{-# LANGUAGE OverloadedStrings #-} module Unit.Service.CrawlerServiceTest (tests) where import Control.Applicative ((<$>)) import Data.Text import Service.CrawlerService import Test.HUnit import Text.HTML.TagSoup (Tag(..)) tests = [ "runs crawler" ~: test [ testIO (runCrawler fetcherMock1 "git.io" ["http://k.n...
ptek/sclent
tests/Unit/Service/CrawlerServiceTest.hs
Haskell
bsd-3-clause
1,416
{-# LANGUAGE FlexibleInstances #-} module Network.SPDY.Internal.Serialize where import Blaze.ByteString.Builder import Data.Bits (setBit, shiftL, shiftR, (.&.)) import Data.ByteString (ByteString) import qualified Data.ByteString as B import Data.List (foldl') import Data.Monoid import Data.Word (Word8, Word16, Word...
kcharter/spdy-base
src/Network/SPDY/Internal/Serialize.hs
Haskell
bsd-3-clause
7,641
module Problem16 ( powerDigitSum ) where import Lib (digits) powerDigitSum :: Integer -> Integer -> Integer powerDigitSum x pow = sum.digits $ x^pow
candidtim/euler
src/Problem16.hs
Haskell
bsd-3-clause
157
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} -- | A @Trajectory@ instance based on a chronologically ordered -- list of data. The start and end times are determined by the -- first and last datum in the list. module Astro.Trajectory.EphemTrajectory ( EphemTrajectory (ET) ) where impor...
bjornbm/astro-orbit
Astro/Trajectory/EphemTrajectory.hs
Haskell
bsd-3-clause
2,598
{-# OPTIONS_GHC -fno-warn-missing-fields #-} {-# LANGUAGE TypeSynonymInstances, StandaloneDeriving, DeriveDataTypeable, FlexibleInstances, TypeOperators #-} module Database.PostgreSQL.Simple.Tuple.Common ( groupJoin , tuple2 , tuple3 , tuple4 , tuple5 , tuple6 , tuple7 , tuple8 , tuple9 , tuple10 , tuple11 ...
cimmanon/postgresql-simple-tuple
src/Database/PostgreSQL/Simple/Tuple/Common.hs
Haskell
bsd-3-clause
12,425
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-missing-fields #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -------------------...
Orvid/fbthrift
thrift/compiler/test/fixtures/service-fuzzer/gen-hs/TestService_Client.hs
Haskell
apache-2.0
3,722
{-# LANGUAGE PackageImports #-} module Propellor.Property where import System.Directory import Control.Monad import Data.Monoid import Control.Monad.IfElse import "mtl" Control.Monad.Reader import Propellor.Types import Propellor.Info import Propellor.Engine import Utility.Monad import System.FilePath -- Constructs...
abailly/propellor-test2
src/Propellor/Property.hs
Haskell
bsd-2-clause
5,033
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} {-# OPTIONS -Wall #-} module Main(main) where import qualified Data.Text.IO as T import Data.Typeable import Hydro import qualified Language.Paraiso.Annotation as Anot import qualified Language.Paraiso.Annotation.Allocation as Alloc import ...
nushio3/Paraiso
examples-old/Hydro-exampled/HydroMain.hs
Haskell
bsd-3-clause
10,530
-- | Miscellaneous utilities for various parts of the library module Reddit.Utilities ( unescape ) where import Data.Text (Text) import qualified Data.Text as Text -- | Quick-'n'-dirty unescaping function for posts / wiki pages etc.. unescape :: Text -> Text unescape = replace "&gt;" ">" . replace "&lt;" "<" . repl...
intolerable/reddit
src/Reddit/Utilities.hs
Haskell
bsd-2-clause
586
{-# LANGUAGE CPP, BangPatterns #-} module Aws.S3.Core where import Aws.Core import Control.Arrow ((***)) import Control.Monad import Control.Monad.IO.Class import Control.Monad.Trans.Resource (MonadThrow, throwM) import Crypto.Hash import ...
romanb/aws
Aws/S3/Core.hs
Haskell
bsd-3-clause
20,800
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} module Stack.ConfigSpec where import Data.Aeson.Extended import Data.Yaml import Path import Path.IO hiding (withSystemTempDir) import Stack.Config import Stack.Prelude import Stack....
MichielDerhaeg/stack
src/test/Stack/ConfigSpec.hs
Haskell
bsd-3-clause
6,310
module GetContents where import qualified Github.Repos as Github import Data.List import Prelude hiding (truncate, getContents) main = do putStrLn "Root" putStrLn "====" getContents "" putStrLn "LICENSE" putStrLn "=======" getContents "LICENSE" getContents path = do contents <- Github.contentsFor "mik...
bitemyapp/github
samples/Repos/Contents.hs
Haskell
bsd-3-clause
1,346
module Parse.Binop (binops, OpTable) where import qualified Data.List as List import qualified Data.Map as Map import Text.Parsec ((<|>), choice, getState, try) import AST.Declaration (Assoc(L, N, R)) import AST.Expression.General (Expr'(Binop)) import qualified AST.Expression.Source as Source import qualified AST.Va...
laszlopandy/elm-compiler
src/Parse/Binop.hs
Haskell
bsd-3-clause
3,497
module T16114 where data T a instance Eq a => Eq a => Eq (T a) where (==) = undefined
sdiehl/ghc
testsuite/tests/rename/should_fail/T16114.hs
Haskell
bsd-3-clause
87
{-# htermination enumFromTo :: Int -> Int -> [Int] #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_enumFromTo_4.hs
Haskell
mit
55
{-# LANGUAGE LambdaCase, ConstraintKinds #-} ------------------------------------------------------------------------------ -- | -- Module : RemindHelpers -- Copyright : (C) 2014 Samuli Thomasson -- License : BSD-style (see the file LICENSE) -- Maintainer : Samuli Thomasson <samuli.thomasson@pa...
TK009/loyly
RemindHelpers.hs
Haskell
mit
2,973
{-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE...
jhedev/todobackend-servant
src/Main.hs
Haskell
mit
5,848
{-# OPTIONS_GHC -XTypeFamilies -XRank2Types #-} {-| This library provides a collection of monad transformers that can be combined to produce various monads. -} module MonadLib ( -- * Types -- $Types Id, Lift, IdT, ReaderT, WriterT, StateT, ExceptionT, ChoiceT, ContT, -- * Lifting -- $Lifting MonadT(..)...
yav/monadlib
experimental/MonadLibTF.hs
Haskell
mit
24,318
module Main ( main ) where {- Automatic solver for Android game "tents & trees" -} {- Design: for now I think the most difficult part will be, given an image, to recognize board position and extract board configuration from it. good old matchTemplate should work, but here I want to see if there are b...
Javran/misc
auto-tents/src/Main.hs
Haskell
mit
2,344
module Part2 where import Control.Monad data Item = Item { name :: String, description :: String, weight :: Int, value :: Int } | Weapon { name :: String, description :: String, weight :: Int, value :: Int, damage :: Int } | Armor { name :: String, description :: String, weight :: Int, value :...
utilForever/ProgrammingPractice
Solutions/MoNaDDu/Game Shop/3/Part3.hs
Haskell
mit
4,510
module NeatInterpolation.String where import NeatInterpolation.Prelude unindent :: [Char] -> [Char] unindent s = case lines s of head : tail -> let unindentedHead = dropWhile (== ' ') head minimumTailIndent = minimumIndent . unlines $ tail unindentedTail = case minimumTailInden...
nikita-volkov/neat-interpolation
library/NeatInterpolation/String.hs
Haskell
mit
1,083
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.NavigatorUserMediaError (js_getConstraintName, getConstraintName, NavigatorUserMediaError, castToNavigatorUserMediaError, gTypeNavigatorUserMediaError) where import Prelude ((.), (==), (>>=),...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/NavigatorUserMediaError.hs
Haskell
mit
1,537
{-# LANGUAGE OverloadedStrings, FlexibleContexts, ScopedTypeVariables #-} module ProcessStatus ( processStatuses , RetryAPI(..) ) where import Data.Conduit import Data.Conduit.Binary import qualified Data.Conduit.Attoparsec as CA import Network.HTTP.Conduit import qualified ...
blitzcode/jacky
src/ProcessStatus.hs
Haskell
mit
10,047
{-# htermination concat :: [[a]] -> [a] #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_concat_1.hs
Haskell
mit
44
{-# LANGUAGE OverloadedStrings #-} module Ledger ( accountMap , findParents , transactionLine ) where import Data.Maybe import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import qualified Data.Text as T import qualified Data.Text.Lazy as TL import qualified Data.Text.Lazy.Builder as...
pharaun/hGnucash
src/Ledger.hs
Haskell
apache-2.0
4,991
module GTKMain (main) where import Debug import BattleContext import GTKInitialization (initUI, buildUI, setupUI, startUI) import Data.IORef import Control.Monad.Trans.Reader (runReaderT) dataDir = "/usr/home/nbrk/projects/haskell/ld/executable" main :: IO () main = do putInfo "Starting GTK application" putIn...
nbrk/ld
executable/GTKMain.hs
Haskell
bsd-2-clause
522
{-# LANGUAGE Haskell2010 #-} -- | Math (display) for 'normalDensity' -- -- \[ -- \int_{-\infty}^{\infty} e^{-x^2/2} = \sqrt{2\pi} -- \] -- -- \(\int_{-\infty}^{\infty} e^{-x^2/2} = \sqrt{2\pi}\) module Math where -- | Math (inline) for 'normalDensity' -- \(\int_{-\infty}^{\infty} e^{-x^2/2} = \sqrt{2\pi}\) -- \[\int_...
haskell/haddock
html-test/src/Math.hs
Haskell
bsd-2-clause
372
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE CPP #-} #if __GLASGOW_HASKELL__ >= 800 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-} #endif {-# OPTIONS_GHC -fno-warn-dodgy-exports #-} module Text.RE.PCRE ( -- * Tutorial -- $tutorial -- * The Overloaded Match Operators ...
cdornan/idiot
Text/RE/PCRE.hs
Haskell
bsd-3-clause
2,481
{-| Module : Idris.IdeMode Description : Idris' IDE Mode Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} {-# LANGUAGE FlexibleInstances, IncoherentInstances, PatternGuards #-} module Idris.IdeMode(parseMessage, convSExp, WhatDocs(..), IdeModeC...
uuhan/Idris-dev
src/Idris/IdeMode.hs
Haskell
bsd-3-clause
17,331