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 |
|---|---|---|---|---|---|
-- PutJSON.hs
module PutJSON where
import Data.List (intercalate)
import SimpleJSON
renderJValue :: JValue -> String
renderJValue (JString s) = show s
renderJValue (JNumber n) = show s
renderJValue (JBool True) = "true"
renderJValue (JBool False) = "false"
renderJValue (JNull) = "null"
renderJValue (JOb... | sammyd/Learning-Haskell | ch05/PutJSON.hs | Haskell | mit | 696 |
type Vector = (Double, Double)
data Shape = Circle Vector Double
| Poly [Vector]
| akampjes/learning-realworldhaskell | ch03/ShapeUnion.hs | Haskell | mit | 97 |
{-# LANGUAGE Rank2Types #-}
module TeX.Parser.Assignment
where
import Text.Parsec ((<|>), (<?>), modifyState, getState, anyToken)
import Control.Lens ((.~), (^.))
import TeX.Alias
import TeX.Category
import TeX.Count
import TeX.Def hiding (definition)
import TeX.Parser.MacroParser
import TeX.Parser.Parser
import TeX.... | xymostech/tex-parser | src/TeX/Parser/Assignment.hs | Haskell | mit | 4,587 |
module Observable.Examples (
betaBinomial
, linearFit
, sinusoidal
, sinusoidalModel
, simulate
, ast
, condition
) where
import Observable
-- | A simple beta-binomial model for testing.
betaBinomial :: Int -> Double -> Double -> Observable Int
betaBinomial n a b = do
p <- observe "p" (beta a b)... | jtobin/observable-examples | Observable/Examples.hs | Haskell | mit | 1,626 |
{-# LANGUAGE Arrows #-}
module Logic (logic) where
import Prelude hiding (id, (.))
import Control.Applicative (pure)
import Control.Category
import Control.Arrow
import Control.Coroutine
import Control.Coroutine.FRP
import Lambda.OpenGL (KeyEvent(..))
import Lambda.Vector
import ViewModel
logic :: Coroutine [KeyE... | leonidas/lambda-frp | src/Logic.hs | Haskell | mit | 477 |
{- Copyright 2014 David Farrell <shokku.ra@gmail.com>
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or... | shockkolate/lambdircd | src/IRCD/Logic.hs | Haskell | apache-2.0 | 2,083 |
module Combinatorics where
import Control.Lens
triplets :: [a] -> [(a,a,a)]
triplets (a : b : c : xs) = [(a,b,c)] ++ [(x,y,z) | x <- [a,b,c], (y,z) <- pairs xs] ++ [(x,y,z) | (x,y) <- pairs [a,b,c], z <- xs] ++ triplets xs
triplets _ = []
-- return the list of all unordered pairs
pairs :: [a] -> [(a,a)]
pairs (a : b ... | epeld/zatacka | old/Combinatorics.hs | Haskell | apache-2.0 | 715 |
module Main where
import System.IO ( hSetBuffering
, BufferMode( LineBuffering )
, stdout
)
import Control.Concurrent
import Control.Concurrent.STM
import Control.Concurrent.STM.TChan
-----------------------------------------------------------------
-- An alternative "stateless"... | dimitriv/ziria-sem | Haskell/ZirPar.hs | Haskell | apache-2.0 | 7,526 |
{-# LANGUAGE RecordWildCards #-}
module NLP.LTAG.Tree
(
-- * Tree
Tree (..)
, showTree
, showTree'
, toWord
-- * Path
, Path
, follow
-- * Substitution
, subst
-- * Adjoining
, AuxTree (..)
, adjoin
-- * Derivation
, Deriv
, Trans
, derive
-- * Traversal
, walk
) where
import Control.Applicative ((<$>))... | kawu/ltag | src/NLP/LTAG/Tree.hs | Haskell | bsd-2-clause | 5,210 |
{-# LANGUAGE FlexibleInstances, RankNTypes #-}
{-# OPTIONS_GHC -Wall #-}
{- |
Module : SystemFI
Description : Abstract syntax and pretty printer for SystemFI.
Copyright : (c) 2014—2015 The F2J Project Developers (given in AUTHORS.txt)
License : BSD3
Maintainer : Zhiyuan Shi <zhiyuan.shi@gmail.... | wxzh/fcore | lib/SystemFI.hs | Haskell | bsd-2-clause | 15,358 |
{-# LANGUAGE QuasiQuotes #-}
module Test0 () where
import LiquidHaskell
[lq| type Nat = { v:Int | 0 <= v } |]
[lq| ok :: Nat -> Nat |]
ok x = hi
where
hi :: [lq| Nat |]
hi = x
| spinda/liquidhaskell | benchmarks/gsoc15/pos/test2.hs | Haskell | bsd-3-clause | 191 |
-- | Metamodel bridge to Snap permissions wrt roles from
-- 'Snap.Snaplet.Auth'.
module Snap.Snaplet.Redson.Permissions
( SuperUser(..)
-- * Commit checking
, checkWrite
, filterUnreadable
-- * Whole-model functions
, getModelPermissions
, stripModel
)
where
import Data.Lens.Common
i... | dzhus/snaplet-redson | src/Snap/Snaplet/Redson/Permissions.hs | Haskell | bsd-3-clause | 5,310 |
{-# LANGUAGE CPP, ViewPatterns #-}
module TcFlatten(
FlattenMode(..),
flatten, flattenManyNom,
unflatten,
) where
#include "HsVersions.h"
import TcRnTypes
import TcType
import Type
import TcEvidence
import TyCon
import TyCoRep -- performs delicate algorithm on types
import Coercion
import Var
import Var... | vikraman/ghc | compiler/typecheck/TcFlatten.hs | Haskell | bsd-3-clause | 59,811 |
{-|
Module : Reactive.DOM.Internal.Mutation
Description : Definition of Mutation, to describe DOM updates.
Copyright : (c) Alexander Vieth, 2016
Licence : BSD3
Maintainer : aovieth@gmail.com
Stability : experimental
Portability : non-portable (GHC only)
-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE FlexibleInst... | avieth/reactive-dom | Reactive/DOM/Internal/Mutation.hs | Haskell | bsd-3-clause | 2,787 |
-- 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.Volume.HR.Tests
( tests ) where
import Data.String
import Prelude
import Test.Tasty
import Duc... | facebookincubator/duckling | tests/Duckling/Volume/HR/Tests.hs | Haskell | bsd-3-clause | 500 |
-----------------------------------------------------------------------------
-- |
-- Module : TestSuite.Puzzles.Coins
-- Copyright : (c) Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
--
-- Test suite for Data.SBV.Examples.Puzzles.Coins
------------------... | josefs/sbv | SBVTestSuite/TestSuite/Puzzles/Coins.hs | Haskell | bsd-3-clause | 912 |
{-# LANGUAGE OverloadedStrings, LambdaCase, QuasiQuotes #-}
module Transformations.Simplifying.CaseSimplificationSpec where
import Control.Monad
import Data.Monoid hiding (Alt)
import Transformations.Simplifying.CaseSimplification
import Test.Hspec
import Test.QuickCheck hiding (generate)
import Test.Test
import Test... | andorp/grin | grin/test/Transformations/Simplifying/CaseSimplificationSpec.hs | Haskell | bsd-3-clause | 3,413 |
module Graphics.Gnuplot.Execute where
import Graphics.Gnuplot.Private.OS (gnuplotName, )
import System.Exit (ExitCode, )
import System.IO (hPutStr, )
import qualified System.Process as Proc
simple ::
[String] {-^ The lines of the gnuplot script to be piped into gnuplot -}
-> [String] {-^ Options for gnuplo... | kubkon/gnuplot | execute/pipe/Graphics/Gnuplot/Execute.hs | Haskell | bsd-3-clause | 557 |
--------------------------------------------------------------------------------
-- | Call into the Haskell LLVM API to generate LLVM bitcode.
--
module Llvm.CodeOutput where
-- import ErrUtils
-- import Outputable
import Llvm.AbsSyn as AbsSyn
import Llvm.MetaData
import Llvm.Types
import Llvm.TypeConversions
impo... | a-ford/notghc | Llvm/CodeOutput.hs | Haskell | bsd-3-clause | 22,098 |
{-|
Module : Preliminaries
Copyright : © Yghor Kerscher, 2016
Licence : BSD-3
Maintainer : kerscher@acm.org
Stability : experimental
The Haskell Report specifies the <https://www.haskell.org/onlinereport/standard-prelude.html Prelude> with a minimal amount of definitions that are always available in scop... | kerscher/preliminaries | source/Preliminaries.hs | Haskell | bsd-3-clause | 7,637 |
-----------------------------------------------------------------------------
-- |
-- Module : Data.SBV.BitVectors.Model
-- Copyright : (c) Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
--
-- Instance declarations for our symbolic world
------------------... | TomMD/cryptol | sbv/Data/SBV/BitVectors/Model.hs | Haskell | bsd-3-clause | 88,082 |
{-# LANGUAGE UnicodeSyntax #-}
module Typed.Parser where
import Control.Applicative ((<|>))
import qualified Text.Parsec.Language as L
import qualified Text.Parsec.Token as T
import Text.ParserCombinators.Parsec (Parser, alphaNum, chainl1,
... | ayberkt/TAPL | src/Typed/Parser.hs | Haskell | bsd-3-clause | 2,587 |
{-# LANGUAGE GeneralizedNewtypeDeriving
, StandaloneDeriving
, TemplateHaskell
, UnicodeSyntax
#-}
module System.FTDI.Properties where
-------------------------------------------------------------------------------
-- Imports
--------------------------------------------------------... | roelvandijk/ftdi | System/FTDI/Properties.hs | Haskell | bsd-3-clause | 3,569 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Tinc.Sandbox (
PackageConfig
, Sandbox
, findPackageDb
, initSandbox
, recache
) where
import Prelude ()
import Prelude.Compat
import Control.Monad.Comp... | beni55/tinc | src/Tinc/Sandbox.hs | Haskell | bsd-3-clause | 2,410 |
{-# LANGUAGE TemplateHaskell #-}
module Language.Eiffel.Position
(Pos (..)
,Line
,Column
,SourcePos
,sourceLine
,sourceColumn
,sourceName
,inheritPos
,attachPos
,attachPosM
,attachEmptyPos
,attachPosBefore
,attachPosHere
,takePos
,position
... | scottgw/language-eiffel | Language/Eiffel/Position.hs | Haskell | bsd-3-clause | 1,915 |
module Util.System(tempfile,withTempdir,rmFile,catchIO) where
-- System helper functions.
import Control.Monad (when)
import System.Directory (getTemporaryDirectory
, removeFile
, removeDirectoryRecursive
, createDirectoryIfMissing
... | andyarvanitis/Idris-dev | src/Util/System.hs | Haskell | bsd-3-clause | 1,488 |
{-
%
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
TcGenDeriv: Generating derived instance declarations
This module is nominally ``subordinate'' to @TcDeriv@, which is the
``official'' interface to deriving-related things.
This is where we do all the grimy bindings... | nushio3/ghc | compiler/typecheck/TcGenDeriv.hs | Haskell | bsd-3-clause | 103,881 |
{-# Language TypeFamilies #-}
module Data.Source.String.Offset where
import Data.Source.Class
data Src
= Src
{ loc :: Int
, str :: [Char]
} deriving (Eq,Ord,Read,Show)
instance Source Src where
type Location Src = Int
type Element Src = Char
type Token Src = [Char]
type Error Src = () -- errors a... | permeakra/source | Data/Source/String/Offset.hs | Haskell | bsd-3-clause | 761 |
module Algebra.Structures.Field
( module Algebra.Structures.IntegralDomain
, Field(..)
, (</>)
) where
import Algebra.Structures.IntegralDomain
class IntegralDomain a => Field a where
inv :: a -> a
(</>) :: Field a => a -> a -> a
x </> y = x <*> inv y
infixl 7 </>
| Alex128/abstract-math | src/Algebra/Structures/Field.hs | Haskell | bsd-3-clause | 292 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Todo.Changelog (
-- * The Log type
Log (..),
logHead,
-- * Log entries
LogEntry (..),
... | neosam/haskelltodo | src/Todo/Changelog.hs | Haskell | bsd-3-clause | 10,426 |
module Propellor.Property.Tor where
import Propellor
import qualified Propellor.Property.File as File
import qualified Propellor.Property.Apt as Apt
isBridge :: Property
isBridge = setup `requires` Apt.installed ["tor"]
`describe` "tor bridge"
where
setup = "/etc/tor/torrc" `File.hasContent`
[ "SocksPort 0"
,... | abailly/propellor-test2 | src/Propellor/Property/Tor.hs | Haskell | bsd-2-clause | 486 |
-- |
-- Module : Crypto.Number.Serialize.Internal.LE
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : experimental
-- Portability : Good
--
-- Fast serialization primitives for integer using raw pointers (little endian)
{-# LANGUAGE BangPatterns #-}
module Crypto.Num... | vincenthz/cryptonite | Crypto/Number/Serialize/Internal/LE.hs | Haskell | bsd-3-clause | 2,415 |
{-# LANGUAGE RecordWildCards #-}
record = 1 | bitemyapp/apply-refact | tests/examples/Extensions13.hs | Haskell | bsd-3-clause | 44 |
{-# language MagicHash #-}
{-# language UnboxedTuples #-}
module CopyArray
( smallCopy
) where
import GHC.Exts
import GHC.IO
data ByteArray = ByteArray ByteArray#
-- Does an 8 byte copy with sub-word (2 bytes) alignment
-- Should be unrolled into 4 aligned stores (MOVWs)
smallCopy :: ByteArray -> IO ByteArray
s... | sdiehl/ghc | testsuite/tests/codeGen/should_gen_asm/bytearray-memcpy-unroll.hs | Haskell | bsd-3-clause | 552 |
module GuardsIn1 where
f :: [Int] -> Int
f g
| g == [1] = 42
| otherwise = head g | kmate/HaRe | old/testing/introCase/GuardsIn1.hs | Haskell | bsd-3-clause | 94 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="fil-PH">
<title>Passive Scan Rules | ZAP Extension</title>
<maps>
<homeID>top</homeID>
... | ccgreen13/zap-extensions | src/org/zaproxy/zap/extension/pscanrules/resources/help_fil_PH/helpset_fil_PH.hs | Haskell | apache-2.0 | 981 |
module Utility where
isDots :: String -> Bool
isDots s = (s == ".") || (s == "..")
isManaged :: FilePath -> Bool
isManaged s = (s /= ".towhead.db") && (not $ isDots s) && (s /= ".dat")
| wangell/towhead | Utility.hs | Haskell | mit | 187 |
{-# LANGUAGE ScopedTypeVariables #-}
module CNFSet (tests) where
import BooleanLaws
import NegableLaws
import SimplifyLaws
import BooleanModelLaws
import FreeBoolean
import Test.Tasty
import Test.QuickCheck
import Control.Applicative
import Data.Monoid
import Data.Function (on)
import Data.Algebra.Boolean.Negable ... | phadej/boolean-normal-forms | tests/CNFSet.hs | Haskell | mit | 805 |
{-# LANGUAGE RecordWildCards #-}
-- import Control.Monad.State
import Data.Monoid
import Data.Maybe()
import Text.Read()
import System.Exit
type Point = Int
newtype Region = Region (Point, Point) deriving (Eq, Show)
instance Monoid Region where
mempty = Region (0, 0)
mappend (Region (begin, _)) (Region(_, en... | bollu/hask-lisp-interp | src/Main.hs | Haskell | mit | 9,947 |
{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.QuickTimePluginReplacement
(postEvent, getMovieSize, getTimedMetaData, getAccessLog,
getErrorLog, QuickTi... | ghcjs/jsaddle-dom | src/JSDOM/Generated/QuickTimePluginReplacement.hs | Haskell | mit | 2,756 |
{-# LANGUAGE OverloadedStrings #-}
module ReactHaskell.Handler where
import Application
import ReactHaskell.Persistence
import Snap.Core
import Snap.Extras.CoreUtils
import Snap.Extras.JSON
import Snap.Snaplet.Heist
import Snap.Snaplet.PostgresqlSimple
index :: AppHandler ()
index = render "index"
getTodos :: AppHa... | sestrella/react-haskell | src/ReactHaskell/Handler.hs | Haskell | mit | 846 |
module Network.CryptoNote.Types where
import Network.CryptoNote.Crypto.Types (PublicKey, SecretKey)
import Data.Binary (Binary (..))
-- cryptonote_core/cryptonote_basic.h
data AccountPublicAddress = AccountPublicAddress {
spendPubKey :: PublicKey,
viewPubKey :: PublicKey
} deriving (Eq, Show)
data KeyPair = ... | nvmd/hs-cryptonote | src/Network/CryptoNote/Types.hs | Haskell | mit | 774 |
{-# LANGUAGE RankNTypes, FlexibleInstances, FlexibleContexts, MultiWayIf #-}
{-# LANGUAGE LiberalTypeSynonyms, ImpredicativeTypes #-}
import Haste
import Haste.DOM
import Haste.Events
import Haste.Foreign hiding (get)
import Haste.Graphics.Canvas
import Haste.Graphics.AnimationFrame
import Control.Applicative
import Co... | myuon/hakoniwa | src/main.hs | Haskell | mit | 14,889 |
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI, UnliftedFFITypes,
GHCForeignImportPrim, DeriveDataTypeable, GHCForeignImportPrim #-}
module GHCJS.Foreign.Callback
( Callback
, OnBlocked(..)
, releaseCallback
-- * asynchronous callbacks
, asyncCallback
, asyncCallback1
, ... | ghcjs/ghcjs-base | GHCJS/Foreign/Callback.hs | Haskell | mit | 7,041 |
module Timeline.Parser
( parseGraphs
) where
import Data.Text (Text)
import qualified Data.Text as T
import Text.Megaparsec
import Text.Megaparsec.Text
import Timeline.Parser.Aggregate
import Timeline.Parser.Graph
import Timeline.Parser.Internal
impor... | joshuaclayton/timeline | src/Timeline/Parser.hs | Haskell | mit | 1,513 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.HTMLDivElement
(js_setAlign, setAlign, js_getAlign, getAlign, HTMLDivElement,
castToHTMLDivElement, gTypeHTMLDivElement)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/HTMLDivElement.hs | Haskell | mit | 1,804 |
-----------------------------------------------------------------------------
-- $Id: HsPretty.hs,v 1.10 2001/12/17 03:38:54 bjpop Exp $
--
-- (c) The GHC Team, Noel Winstanley 1997-2000
--
-- Pretty printer for Haskell.
--
-----------------------------------------------------------------------------
module FrontEnd.... | m-alvarez/jhc | src/FrontEnd/HsPretty.hs | Haskell | mit | 26,684 |
{-# htermination fmap :: Functor f => (a -> b) -> (f a -> f b) #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_fmap_1.hs | Haskell | mit | 67 |
module Spelling (TrainingDict, nWords, correct) where
import qualified Data.ByteString.Char8 as B
import Data.Char (isAlpha, toLower)
import Data.List (foldl', maximumBy)
import qualified Data.Map.Strict as M
import qualified... | MarcoSero/Norvigs-Spelling-Corrector | src/Spelling.hs | Haskell | mit | 2,555 |
module PPL2.Pretty.AProg where
import PPL2.Prelude
import PPL2.VM.Types (AProg, ACode, AInstr)
import PPL2.Pretty.Instr (prettyInstr, fillLeft)
import PPL2.Pretty.MProg (prettyData)
import PPL2.System.Types (MonadCompile)
-- ----------------------------------------
prettyAProg :: (Show v) => (ACode, [v]) -> Stri... | UweSchmidt/ppl2 | src/PPL2/Pretty/AProg.hs | Haskell | mit | 849 |
module FullSubsetsSpec (spec) where
import Test.Hspec
import DecisionTrees.Utils
import qualified Data.Set as Set
spec :: Spec
spec = describe "DecisionTrees.Utils.fullSubsets" $
it "should return a set of possible set splittings" $ do
example $ fullSubsets (Set.fromList [1..2]) `shouldBe` Set.fr... | fehu/min-dat--decision-trees | test/FullSubsetsSpec.hs | Haskell | mit | 1,928 |
module Control.Concurrent.Actor.Tests where
import Control.Concurrent.Actor hiding ( receive, spawnReceive )
import Control.Concurrent.Actor.Debug
-- -----------------------------------------------------------------------------
-- * @receive@ is non busy
testReceive1 :: IO ()
testReceive1 = do
act <- spawnReceive... | treep/hactors | Control/Concurrent/Actor/Tests.hs | Haskell | mit | 1,141 |
module Main.Command.Help ( command ) where
import System.Environment ( getProgName )
import System.IO
import Text.Printf ( printf )
import Main.Command as Cmd
command :: [Cmd.Command] -> Cmd.Command
command cs = Cmd.Command (thisAction cs) "help" "Show usage ... | rjw57/cloudsync | cs/Main/Command/Help.hs | Haskell | mit | 1,763 |
module Tokenize
( tokenizeExpr )
where
import Data.Char (isDigit, isSeparator)
type Tokens = [String]
operators :: String
operators = "+-*/()"
pushIntIfNecessary :: (Tokens, String) -> Tokens
pushIntIfNecessary (tokens, "") = tokens
pushIntIfNecessary (tokens, int) = int:tokens
traverseExpr :: (Tokens, String) -> ... | DanielBrookRoberge/learning-calculator | haskell/Tokenize.hs | Haskell | mit | 731 |
import qualified SRC.Log as Log
main = undefined
-- logging boilerplate
filename = "Main.hs"
fatal :: Show a => String -> a -> b
fatal msg line = Log.reportFatal filename msg line
fixme, bug, err :: Show a => a -> b
fixme = fatal L.fixMe
bug = fatal L.bug
err = fatal L.err
| Fornost461/drafts-and-stuff | Haskell/samples/Template/SRC/Main.hs | Haskell | cc0-1.0 | 280 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Utils
-- Copyright : (c) The University of Glasgow 2001-2002,
-- Simon Marlow 2003-2006,
-- David Waern 2006-2009
-- License : BSD-like
--
-- M... | randen/haddock | haddock-api/src/Haddock/Utils.hs | Haskell | bsd-2-clause | 18,236 |
-- |
-- Module : Text.Megaparsec.Char
-- Copyright : © 2015 Megaparsec contributors
-- © 2007 Paolo Martini
-- © 1999–2001 Daan Leijen
-- License : BSD3
--
-- Maintainer : Mark Karpov <markkarpov@opmbx.org>
-- Stability : experimental
-- Portability : portable
--
-- Com... | omefire/megaparsec | Text/Megaparsec/Char.hs | Haskell | bsd-2-clause | 10,984 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE BangPatterns, CPP, ForeignFunctionInterface,
ScopedTypeVariables #-}
-- |
-- Module : Criterion.Measurement
-- Copyright : (c) 2009-2014 Bryan O'Sullivan
--
-- License : BSD-style
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability :... | iu-parfunc/criterion | Criterion/Measurement.hs | Haskell | bsd-2-clause | 7,086 |
-- Vectorise a modules type and class declarations.
--
-- This produces new type constructors and family instances top be included in the module toplevel
-- as well as bindings for worker functions, dfuns, and the like.
module Vectorise.Type.Env (
vectTypeEnv,
) where
#include "HsVersions.h"
import Vectorise.En... | ilyasergey/GHC-XAppFix | compiler/vectorise/Vectorise/Type/Env.hs | Haskell | bsd-3-clause | 20,722 |
-- these bindings were derived from the `lzma-enumerator` package
#include <stdio.h>
#include <string.h>
#include <bindings.dsl.h>
#include <lzma.h>
module LibLzma where
#strict_import
-- lzma_ret
#integral_t lzma_ret
#num LZMA_OK
#num LZMA_STREAM_END
#num LZMA_NO_CHECK
#num LZMA_UNSUPPORTED_CHECK
#num LZMA_GET_CH... | hvr/lzma-streams | src/foo.hs | Haskell | bsd-3-clause | 2,542 |
{-# LANGUAGE CPP #-}
-- Module: Blaze.Text.Double
-- Copyright: (c) 2011 MailRank, Inc.
-- License: BSD3
-- Maintainer: Bryan O'Sullivan <bos@serpentine.com>
-- Stability: experimental
-- Portability: portable
--
-- Efficiently serialize a Double as a lazy 'L.ByteString'.
module Blaze.Text.Double
(
... | bos/blaze-textual | Blaze/Text/Double.hs | Haskell | bsd-3-clause | 654 |
module Level
( fillVoid
, loadLevel
) where
import Data.Array.IArray
import Types
import Utils
chrToBlock :: Char -> Block
chrToBlock 'X' = Wall
chrToBlock _ = Empty
loadLevel :: [String] -> [(Char, Coords -> Actor ())] -> (Level, [Actor ()])
loadLevel input actorMap =
let level = fillVoid $ parseLeve... | bjornars/HaskellGame | src/Level.hs | Haskell | bsd-3-clause | 2,677 |
{-# LANGUAGE OverloadedStrings #-}
module Y2016.Day22 (answer1, answer2) where
import Control.Monad
import Control.Monad.Loops as Loops
import GHC.Word
import Data.Functor
import Data.Array as Arr
import Data.Void
import qualified Data.Set as Set
import qualified Data.Map.Strict as Map
import Text.Megaparsec
import... | geekingfrog/advent-of-code | src/Y2016/Day22.hs | Haskell | bsd-3-clause | 3,331 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE ViewPatterns #-}
-- | Con... | luigy/stack | src/Stack/Build/ConstructPlan.hs | Haskell | bsd-3-clause | 28,264 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
module Acc.Lift where
import Data.Array.Accelerate
lift2A
:: (Arrays a, Arrays b)
=> (Acc a, Acc b)
-> Acc (a,b)
lift2A = lift
lift3A
:: (Arrays a, Arrays b, Arrays c)
=> (Acc a, Acc b, Acc c)
-> Acc (a... | cpdurham/accelerate-camera-sandbox | src/Acc/Lift.hs | Haskell | bsd-3-clause | 3,250 |
{-# LANGUAGE ExtendedDefaultRules #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wall #-}
-- Metric structure
module Tower.Metric (
-- * Metric
BoundedField(..)
, infinity
, neginfinity
, Metric(..)
, Normed(..)
, Signed(..)
,... | tonyday567/tower | src/Tower/Metric.hs | Haskell | bsd-3-clause | 3,780 |
module AERN2.Linear.Matrix.Type where
import qualified Prelude as P
import MixedTypesNumPrelude
import qualified Numeric.CollectErrors as CN
import AERN2.Linear.Vector.Type (Vector, (!))
import qualified AERN2.Linear.Vector.Type as V
import qualified Data.List as List
-- import Data.Maybe
-- import Debug.Trace
impor... | michalkonecny/aern2 | aern2-mfun/src/AERN2/Linear/Matrix/Type.hs | Haskell | bsd-3-clause | 3,871 |
-- |
-- Module : Git.FastExport.Filter
-- Maintainer : zohar@kelrich.com
--
-- A collection of filters for git
module Git.FastExport.Filter where
import Git.FastExport.Types
import qualified Data.ByteString as B
import Data.List
import qualified Data.Trie as T
splitBranches :: [(Path, Branch)] -> CmdFilter
splitBranch... | lumimies/git-fastexport-filter | src/Git/FastExport/Filter.hs | Haskell | bsd-3-clause | 1,080 |
{-|
This module provides a Template Haskell function for automatically generating
reified typeclass dictionaries for use with "Control.Monad.TestFixture".
These generated dictionaries can be used with functions like
'Control.Monad.TestFixture.unTestFixture' and
'Control.Monad.TestFixture.logTestFixture' to qu... | cjdev/test-fixture | src/Control/Monad/TestFixture/TH.hs | Haskell | bsd-3-clause | 3,878 |
-- 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 #-}
{-# LANGUAGE LambdaCase #-}
module Duckling.Quantity.P... | facebookincubator/duckling | Duckling/Quantity/PT/Rules.hs | Haskell | bsd-3-clause | 2,436 |
{-# LANGUAGE CPP #-}
module Gidl.Backend.Haskell.Interface where
import Data.Monoid
import Data.List (intercalate, nub)
import Data.Char (toUpper)
import Gidl.Types hiding (typeName)
import Gidl.Interface
import Gidl.Schema
import Gidl.Backend.Haskell.Types
import Ivory.Artifact
#if MIN_VERSION_mainland_pretty(0,6,... | GaloisInc/gidl | src/Gidl/Backend/Haskell/Interface.hs | Haskell | bsd-3-clause | 5,975 |
-- | Extra functions for optparse-applicative.
module Options.Applicative.Builder.Extra
(boolFlags
,boolFlagsNoDefault
,maybeBoolFlags
,enableDisableFlags
,enableDisableFlagsNoDefault
,extraHelpOption
,execExtraHelp
,textOption
,textArgument)
where
import Control.Monad (when)
import Options.Applic... | mathhun/stack | src/Options/Applicative/Builder/Extra.hs | Haskell | bsd-3-clause | 4,788 |
{-# LANGUAGE PatternGuards #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
module Idris.Elab.Value(elabVal, elabValBind, elabDocTerms,
elabExec, elabREPL) where
import Idris.AbsSyntax
import Idris.ASTUtils
import Idris.DSL
import Idris.Error
import Idris.Delaborate
import Idris.Imports
impo... | bkoropoff/Idris-dev | src/Idris/Elab/Value.hs | Haskell | bsd-3-clause | 4,932 |
module Problem29 where
import Data.List
main :: IO ()
main = print . length . nub $ [ a ^ b | a <- [2 .. 100], b <- [2 .. 100] ]
| adityagupta1089/Project-Euler-Haskell | src/problems/Problem29.hs | Haskell | bsd-3-clause | 131 |
------------------------------------------------------------------------------
-- |
-- Module : Data.TokyoDystopia
-- Copyright : 8c6794b6 <8c6794b6@gmail.com>
-- License : BSD3
-- Maintainer : 8c6794b6
-- Stability : experimental
-- Portability : non-portable
--
-- Haskell binding for tokyodystopia full ... | 8c6794b6/tokyodystopia-haskell | Database/TokyoDystopia.hs | Haskell | bsd-3-clause | 1,982 |
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Control.THEff
import Control.THEff.Writer
import Control.Monad(forM_)
import Data.Monoid
type IntAccum = Sum Int
mkEff "StrWriter" ''Writer ''String... | KolodeznyDiver/THEff | samples/SampleWriter.hs | Haskell | bsd-3-clause | 708 |
{-# LANGUAGE OverloadedStrings #-}
module Git.FastExport.AuthorFilter
( AuthorDB
, personRename
, personRenameFilter
, loadPersonFile
, loadPersonRename
)
where
import Control.Applicative
import Data.Monoid
import Data.Attoparsec.Char8 as A
import Data.Attoparsec.Combinator as A
import Git... | lumimies/git-fastexport-filter | src/Git/FastExport/AuthorFilter.hs | Haskell | bsd-3-clause | 2,237 |
module Main where
import Test.Framework (defaultMain)
import qualified Controllers.Tests (tests)
import qualified Views.Tests (tests)
main :: IO ()
main = defaultMain [ Views.Tests.tests
, Controllers.Tests.tests ]
| HaskellCNOrg/snap-web | tests/TestSuite.hs | Haskell | bsd-3-clause | 256 |
{-# LANGUAGE QuasiQuotes #-}
module Write.Header where
import Data.List.Extra(nubOrd, intercalate)
import Text.InterpolatedString.Perl6
data Import = Import ModuleName [String]
| ImportQualified ModuleName Alias [String]
newtype Extension = Extension String
deriving (Eq, Ord)
type ModuleName = String... | oldmanmike/vulkan | generate/src/Write/Header.hs | Haskell | bsd-3-clause | 865 |
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -fplugin Brisk.Plugin #-}
{-# OPTIONS_GHC -fplugin-opt Brisk.Plugin:main #-}
module Managed where
import Data.Binary
import GHC.Generics (Generic)
import qualified Data.HashMap.Strict as M
import Control.Distributed.Process hiding (call)
import Control.Distributed.Process... | abakst/brisk-prelude | examples/Managed00.hs | Haskell | bsd-3-clause | 1,522 |
-- | Main module
--
module Main
( main
) where
import Control.Applicative ((<$>))
import System.Environment (getArgs, getProgName)
import System.FilePath (replaceExtension)
import Text.Blaze.Html.Renderer.Utf8 (renderHtml)
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
impo... | jaspervdj/criterion-to-html | src/Criterion/ToHtml.hs | Haskell | bsd-3-clause | 1,008 |
{-# LANGUAGE BangPatterns #-}
module Sound.Ptr
(
module Data.Word
, ElemCount
-- * List-like Ptr
, ptrMap
, ptrMapM
, ptrZip2
, ptrZipM2
, ptrFoldl
, ptrFoldlM
-- * Specialized allocation
-- ** On the stack
, allocaIntArray
, allocaDoubleArray
-- ** On the heap
... | edom/sound | src/Sound/Ptr.hs | Haskell | bsd-3-clause | 4,247 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Text as T (Text (..), pack)
import Rackspace.MailGun
import System.Environment
main :: IO ()
main = do
domain <- getEnv "MAILGUN_DOMAIN"
apiKey <- getEnv "MAILGUN_SECRET"
testAddr <- getEnv... | AndrewRademacher/mailgun | test/Send.hs | Haskell | mit | 735 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE PolyKinds #-}
module DTypes.Combinators
( FApply (..)
, FProd (..)
, FSum (..)
) where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<*>), (<$>))
#endif
import DTypes.Classes
import DTypes.Compose
import DTypes.Trafo
newtype FApply (x :: k) (f :: k -> *)
= FAp... | timjb/frecords | src/DTypes/Combinators.hs | Haskell | mit | 1,650 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
module WaiAppStatic.Listing
( defaultListing
) where
import qualified Text.Blaze.Html5.Attributes as A
import qualified Text.Blaze.Html5 as H
import Text.Blaze ((!))
import qualified Data.Text as T
import Data.Time
im... | beni55/wai | wai-app-static/WaiAppStatic/Listing.hs | Haskell | mit | 6,445 |
through :: Applicative f => Lens' s a -> Lens s t a b -> Lens (f s) (f t) (f a) (f b)
through lens1 lens2 =
lens getBP (flip setBP)
-- (\sa sbt afb s -> sbt s <$> afb (sa s)) getBP (flip setBP)
-- (\sbt afb s -> sbt s <$> afb (getBP s)) (flip setBP)
-- (\afb s -> (flip setBP) s <$> afb (getBP s))
-- \afb s -... | FranklinChen/music-score | sketch/old/Through.hs | Haskell | bsd-3-clause | 1,953 |
-- | Evaluation of 64 bit values on 32 bit platforms.
module SPARC.CodeGen.Gen64 (
assignMem_I64Code,
assignReg_I64Code,
iselExpr64
)
where
import GhcPrelude
import {-# SOURCE #-} SPARC.CodeGen.Gen32
import SPARC.CodeGen.Base
import SPARC.CodeGen.Amode
import SPARC.Regs
import SPARC.AddrMode
... | ezyang/ghc | compiler/nativeGen/SPARC/CodeGen/Gen64.hs | Haskell | bsd-3-clause | 6,153 |
--------------------------------------------------------------------
-- |
-- Module : Text.Atom.Feed.Export
-- Copyright : (c) Galois, Inc. 2008,
-- (c) Sigbjorn Finne 2009-
-- License : BSD3
--
-- Maintainer: Sigbjorn Finne <sof@forkIO.com>
-- Stability : provisional
-- Portability:: portable
-- Descr... | seereason/feed | Text/Atom/Feed/Export.hs | Haskell | bsd-3-clause | 9,090 |
{-# LANGUAGE OverloadedStrings #-}
module Text.Toml.Parser.Spec where
import Test.Tasty (TestTree)
import Test.Tasty.Hspec
import Data.HashMap.Strict (fromList)
import Data.Time.Calendar (Day (..))
import Data.Time.Clock (UTCTime (..))
import ... | amitai-hoze/htoml | test/Text/Toml/Parser/Spec.hs | Haskell | bsd-3-clause | 14,698 |
module Main ( main ) where
import Data.Set ( Set )
import qualified Data.Set as S
import System.FilePath
import Test.HUnit ( assertEqual )
import LLVM.Analysis
import LLVM.Analysis.CallGraph
import LLVM.Analysis.PointsTo.TrivialFunction
import LLVM.Analysis.CallGraphSCCTraversal
import LLVM.Analysis.Util.Testing
impo... | travitch/llvm-analysis | tests/CallGraphTest.hs | Haskell | bsd-3-clause | 1,569 |
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
FlexibleInstances #-}
module ShouldFail where
class Foo f a r | f a -> r where
foo::f->a->r
-- These instances are incompatible because we can unify
-- the first two paramters, though it's rather obscure:
-- p -> (a,b)
-- t -> (,... | vTurbine/ghc | testsuite/tests/typecheck/should_fail/tcfail096.hs | Haskell | bsd-3-clause | 693 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
TcPat: Typechecking patterns
-}
{-# LANGUAGE CPP, RankNTypes #-}
module TcPat ( tcLetPat, TcSigFun, TcPragFun
, TcSigInfo(..), TcPatSynInfo(..)
, findScopedTyVars, isPartialSig
, co... | fmthoma/ghc | compiler/typecheck/TcPat.hs | Haskell | bsd-3-clause | 51,241 |
{-|
Module : Idris.Core.Typecheck
Description : Idris' type checker.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE DeriveFunctor, FlexibleContexts, FlexibleInstances,
MultiParamTypeClasses, PatternGuards #-}
module Idris.Core.Typecheck where
import Idris.Core.E... | Heather/Idris-dev | src/Idris/Core/Typecheck.hs | Haskell | bsd-3-clause | 19,244 |
{-# LANGUAGE DeriveGeneric #-}
module PersistTestPetCollarType where
import Data.Aeson
import Data.Text (Text)
import GHC.Generics
import Database.Persist.TH
data PetCollar = PetCollar {tag :: Text, bell :: Bool}
deriving (Generic, Eq, Show)
instance ToJSON PetCollar
instance FromJSON PetCollar
derivePersistFie... | yesodweb/persistent | persistent-test/src/PersistTestPetCollarType.hs | Haskell | mit | 339 |
module Csv where
-- container
import Data.Tree (Tree(Node,rootLabel))
-- local imports
import qualified Language.Astview.Language as L
import Language.Astview.DataTree (data2tree)
-- Parsec (CSV Parser)
import Data.Generics hiding (Infix)
import Text.ParserCombinators.Parsec
import Text.Parsec.Combinator
import Tex... | RefactoringTools/HaRe | hareview/data/Langs/Csv.hs | Haskell | bsd-3-clause | 749 |
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE OverloadedStrings #-}
module IRTS.JavaScript.AST where
import Data.Word
import Data.Char (isDigit)
import qualified Data.Text as T
data JSType = JSIntTy
| JSStringTy
| JSIntegerTy
| JSFloatTy
| JSCharTy
| JSPtrTy
... | BartAdv/Idris-dev | src/IRTS/JavaScript/AST.hs | Haskell | bsd-3-clause | 11,304 |
-----------------------------------------------------------------------------
-- |
-- Module : Data.Machine
-- Copyright : (C) 2012 Edward Kmett
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Edward Kmett <ekmett@gmail.com>
-- Stability : provisional
-- Portability : non-portable
-... | YoEight/machines | src/Data/Machine.hs | Haskell | bsd-3-clause | 922 |
module C1 where
import D1 hiding (main)
sumSquares1 ((x : xs)) = (x ^ pow) + (sumSquares1 xs)
sumSquares1 [] = 0
| kmate/HaRe | old/testing/unfoldDef/C1_AstOut.hs | Haskell | bsd-3-clause | 114 |
module WhereIn4 where
--In this Example: duplicate the local definition 'y' with new name 'x' will fail.
x = 5
foo,bar::Int->Int
foo x= x + 3
--this is comment
bar z = x + y + z
where
y::Int
y = 3
ram = (let fred = (let x = 5 in x) in fred + x) + 1
main = (foo 1, bar x, ram) | kmate/HaRe | old/testing/duplication/WhereIn4_TokOut.hs | Haskell | bsd-3-clause | 308 |
module ComplexParamIn1 where
--The application of a function is replaced by the right-hand side of the definition,
--with actual parameters replacing formals.
--In this example, unfold the first 'sq' in 'sumSquares'
--This example aims to test unfolding a definition with guards.
sumSquares x y = (case (x, y) of
... | kmate/HaRe | old/testing/unfoldDef/ComplexParamIn1_TokOut.hs | Haskell | bsd-3-clause | 370 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.