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 FlexibleContexts,
MultiParamTypeClasses,
FlexibleInstances
#-}
module DSL.GraphDSL (
-- Types
Equality (..),
Implication (..),
InEquality (..),
Constraint,
Requirement (..),
Graph,
CLD,
graph,
constraints,
Sign (..),
TimeFrame (..),... | GRACeFUL-project/GraphDSL | src/DSL/GraphDSL.hs | Haskell | bsd-3-clause | 6,207 |
-- | An algorithm for merging users' edits. Specifically, there's just one
-- function – 'merge' – and it simply does a three-way diff.
module Guide.Diff.Merge
(
merge,
)
where
import Imports
import Guide.Diff.Tokenize
import qualified Data.Patch as PV
import qualified Data.Text as T
-- | An implementation of a... | aelve/guide | back/src/Guide/Diff/Merge.hs | Haskell | bsd-3-clause | 770 |
{-# LANGUAGE TemplateHaskell #-}
module Database.Esqueleto.Join.TH where
import qualified Data.List as List
import Data.Maybe
import Data.Monoid
import Data.Tagged
import qualified Database.Esqueleto as E
import Language.Haskell.TH
import Language.Haskell.TH.ExpandSyns
import Database.Esqueleto.Join
(<$$>) :: (Func... | pseudonom/dovetail | src/Database/Esqueleto/Join/TH.hs | Haskell | bsd-3-clause | 5,108 |
module HsenvMonadUtils (runInTmpDir) where
import System.Directory
import Util.IO
import HsenvMonad
runInTmpDir :: Hsenv a -> Hsenv a
runInTmpDir m = do
tmp <- liftIO getTemporaryDirectory
tmpDir <- liftIO $ createTemporaryDirectory tmp "hsenv"
oldCwd <- liftIO getCurrentDirectory
liftIO $ setCurrentDirectory... | Paczesiowa/hsenv | src/HsenvMonadUtils.hs | Haskell | bsd-3-clause | 462 |
{-# LANGUAGE RecordWildCards #-}
module Anchor.Tokens.Server (
P.version,
startServer,
ServerState(..),
module X,
) where
import Control.Concurrent
import Control.Concurrent.Async
import Data.Pool
import qualified Data.Streaming.Network as N
import ... | zerobuzz/anchor-token-server | lib/Anchor/Tokens/Server.hs | Haskell | bsd-3-clause | 2,912 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE Typ... | Garygunn94/DFS | ClientProxy/.stack-work/intero/intero7973HSQ.hs | Haskell | bsd-3-clause | 14,674 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
... | nmattia/halytics | src/Halytics/Metric/Statistics.hs | Haskell | bsd-3-clause | 8,593 |
{-# LANGUAGE StandaloneDeriving, FlexibleInstances, BangPatterns #-}
{-# LANGUAGE MultiParamTypeClasses, TypeFamilies #-}
module Data.Array.Matryoshka.PArray.Unboxed (
U.Unbox,
U,
fromVector,
toVector
)
where
import Control.DeepSeq
import Data.Array.Matryoshka.PArray.Base
import qualified Data.Vector.Unboxed a... | agremm/Matryoshka | Data/Array/Matryoshka/PArray/Unboxed.hs | Haskell | bsd-3-clause | 2,368 |
-- | for developing only
--
module Paths_siberia where
getDataFileName ::FilePath -> IO FilePath
getDataFileName = return
getDataDir::IO FilePath
getDataDir = return "."
| chemist/siberia | tmp/Paths_siberia.hs | Haskell | bsd-3-clause | 174 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | A preliminary renderer that produces `ReactJS` components when run using
-- GHCJS.
--
module Text.Blaze.Renderer.ReactJS
( ReactJSNode
, renderHtml
) where
import Control.Applicative
import Control.Monad
imp... | meiersi/blaze-react | src/Text/Blaze/Renderer/ReactJS.hs | Haskell | mit | 17,708 |
-- Copyright 2016 TensorFlow authors.
--
-- 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 agree... | judah/tensorflow-haskell | tensorflow-records-conduit/src/TensorFlow/Records/Conduit.hs | Haskell | apache-2.0 | 1,892 |
{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds #-}
{-# LANGUAGE StandaloneDeriving, FlexibleContexts, DeriveDataTypeable
, UndecidableInstances, FlexibleInstances, MultiParamTypeClasses
, PatternGuards, Rank2Types, TypeSynonymInstances #-}
----------------------------------------------------------... | f1u77y/xmonad-contrib | XMonad/Layout/Groups.hs | Haskell | bsd-3-clause | 21,445 |
module Snap.Internal.Http.Server.TimeoutManager.Tests
( tests ) where
import Control.Concurrent
import Data.IORef
import Data.Maybe
import System.PosixCompat.Time
import System.Timeout
import Test.Framework
import Test.Framework.Providers.HUnit
im... | beni55/snap-server | test/suite/Snap/Internal/Http/Server/TimeoutManager/Tests.hs | Haskell | bsd-3-clause | 1,964 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Sandbox
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- UI for the sandboxing functionality.
----------------------------------------------------------... | tolysz/prepare-ghcjs | spec-lts8/cabal/cabal-install/Distribution/Client/Sandbox.hs | Haskell | bsd-3-clause | 41,442 |
module PackageTests.EmptyLib.Check where
import PackageTests.PackageTester
import System.FilePath
import Test.Tasty.HUnit
-- See https://github.com/haskell/cabal/issues/1241
emptyLib :: FilePath -> Assertion
emptyLib ghcPath = do
let spec = PackageSpec
{ directory = "PackageTests" </> "EmptyLib" </> "emp... | Helkafen/cabal | Cabal/tests/PackageTests/EmptyLib/Check.hs | Haskell | bsd-3-clause | 464 |
{- $Id: AFRPTestsDelay.hs,v 1.2 2003/11/10 21:28:58 antony Exp $
******************************************************************************
* A F R P *
* *
* Module: ... | ony/Yampa-core | tests/AFRPTestsPre.hs | Haskell | bsd-3-clause | 6,766 |
<?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="es-ES">
<title>SVN Digger Files</title>
<maps>
<homeID>svndigger</homeID>
<mapref locat... | kingthorin/zap-extensions | addOns/svndigger/src/main/javahelp/help_es_ES/helpset_es_ES.hs | Haskell | apache-2.0 | 967 |
<?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="pt-BR">
<title>Visualização de Navegador | Extensão ZAP</title>
<maps>
<homeID>top</homeID>
... | thc202/zap-extensions | addOns/browserView/src/main/javahelp/org/zaproxy/zap/extension/browserView/resources/help_pt_BR/helpset_pt_BR.hs | Haskell | apache-2.0 | 994 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE UndecidableInstances #-}
-- #345
module ShouldCompile where
data Succ n
data Zero
class Plus x y z | x y -> z
instance Plus Zero x x
i... | sdiehl/ghc | testsuite/tests/gadt/gadt-fd.hs | Haskell | bsd-3-clause | 622 |
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
-- |
-- Copyright : (C) 2019 team@functionalconcepts.org
-- License : MIT
-- Maintainer : Helmut Merz <helmutm@cy55.de>
-- Stability : experimental
-- Portability : GHC only (requires STM)
--
-- Access to the FCO backend using the fco-actor framework.... | cyberconcepts/fco-backend | src/Fco/Backend/Actor.hs | Haskell | mit | 3,488 |
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
module Language.Erlang.Fold where
import Language.Fold
import Language.Erlang.Algebra
import Language.Erlang.Syntax
instance Fold (ErlangAlgebra pr at fn bv iop exp mat pat gua) Program pr where
fold f (Program mod exs ims des fns) = programF f (fold f m... | arnihermann/timedreb2erl | src/Language/Erlang/Fold.hs | Haskell | mit | 3,586 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RecordWildCards #-}
module U.Util.Cache where
import Prelude hiding (lookup)
import Control.Monad.IO.Class (liftIO)
import UnliftIO (MonadIO, newTVarIO, modifyTVar', writeTVar, atomically, readTVar, readTVarIO)
import qualified Data.Map as Map
import... | unisonweb/platform | codebase2/util/U/Util/Cache.hs | Haskell | mit | 3,354 |
{-# LANGUAGE ImplicitParams #-}
-- | Based on An Introduction to Hybrid Automata by Jean-Francois Raskin
-- http://www.cmi.ac.in/~madhavan/courses/acts2010/Raskin_Intro_Hybrid_Automata.pdf
module WaterHeater where
import Control.Applicative ((<|>))
import Zelus
import CyphyUtils
data TankState = T1 | T2 | T3 | T4 ... | koengit/cyphy | src/WaterHeater.hs | Haskell | mit | 2,723 |
module Database.Siege.Query where
import Data.Char
import Data.List
data SExpr =
Atom String |
List [SExpr]
parse :: String -> SExpr
parse = undefined
generate :: SExpr -> String
generate (List exprs) =
"(" ++ (intercalate " " $ map generate exprs) ++ ")"
generate (Atom var) =
if any isSpace var || elem ')'... | DanielWaterworth/siege | src/Database/Siege/Query.hs | Haskell | mit | 1,082 |
{-# LANGUAGE TypeFamilies, GADTs, TupleSections #-}
module Text.Regex.Applicative.Interface where
import Control.Applicative hiding (empty)
import Control.Arrow
import Control.Monad (guard)
import qualified Data.List as List
import Data.Maybe
import Text.Regex.Applicative.Types
import Text.Regex.Applicative.Object
-- ... | feuerbach/regex-applicative | Text/Regex/Applicative/Interface.hs | Haskell | mit | 11,440 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.CSSRule (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.CSSRule
#else
module Graphics.UI.Gtk.WebKit.DOM.CSSRule
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBK... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/CSSRule.hs | Haskell | mit | 420 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.MediaList
(js_item, item, js_deleteMedium, deleteMedium, js_appendMedium,
appendMedium, js_setMediaText, setMediaText, js_getMediaText,
getMediaText, js_getLength, getLength, MediaList, cast... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/MediaList.hs | Haskell | mit | 3,649 |
-- A module with some code to explore theorems in the monadic lambda calculus
module TP where
import Data.List
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Maybe
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Foldable hiding (concat,any,all)
import Control.Monad.State
import D... | gianlucagiorgolo/glue-tp | TP.hs | Haskell | mit | 16,780 |
module PhotonMap
(
PhotonMap
, PhotonSurfaceInteraction
, count
, generatePhotonMap
, getLightToViewerAtIntersection
)
where
import Numeric.FastMath ( )
import Control.DeepSeq ( NFData(..), force )
import Control.Monad ( replicateM, liftM )
import Data.KdMap.Static ( KdMap, buildWithDist, inRadius )
imp... | stu-smith/rendering-in-haskell | src/experiment08/PhotonMap.hs | Haskell | mit | 6,437 |
{-# LANGUAGE OverloadedStrings #-}
module Y2018.M04.D17.Exercise where
{--
So, yesterday we had a bunch of JSON from various periodicals, but they were
all in the same JSON format, which made it simple to upload them into a common
database.
Today, we have JSON, but in a different format, that we need to upload into
... | geophf/1HaskellADay | exercises/HAD/Y2018/M04/D17/Exercise.hs | Haskell | mit | 1,834 |
-- | Analysis and transformation of SQL queries.
module Database.Selda.Transform where
import Database.Selda.Column
import Database.Selda.SQL
import Database.Selda.Query.Type
import Database.Selda.Types
-- | Remove all dead columns recursively, assuming that the given list of
-- column names contains all names prese... | valderman/selda | selda/src/Database/Selda/Transform.hs | Haskell | mit | 3,098 |
-- Copyright (c) 2016-present, SoundCloud Ltd.
-- All rights reserved.
--
-- This source code is distributed under the terms of a MIT license,
-- found in the LICENSE file.
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
module Kubern... | soundcloud/haskell-kubernetes | lib/Kubernetes/Model/V1/Endpoints.hs | Haskell | mit | 2,506 |
{-# LANGUAGE TemplateHaskell, OverloadedStrings #-}
import Network.Wai.Middleware.OAuth2 as OAuth2
import Network.OAuth.OAuth2
import Keys (googleKey)
import Data.ByteString
import Control.Monad (unless)
import System.Exit (exitFailure)
import Test.QuickCheck.All (quickCheckAll)
import Test.QuickCheck (Property)
impo... | NerdGGuy/wai-middleware-oauth2 | test/test.hs | Haskell | mit | 1,345 |
-- The main module of the application. Performs GLFW-specific initialization and others.
module Main ( main ) where
import Control.Applicative
import Control.Concurrent
import Control.Exception
import Control.Monad
import Control.Monad.Trans
import qualified Graphics.UI.GLFW as GLFW
import System.Environment
import S... | fujiyan/toriaezuzakki | haskell/glfw/keyboard/Rectangle.hs | Haskell | bsd-2-clause | 3,276 |
{-# LANGUAGE BangPatterns #-}
{-| RPC test program.
-}
{-
Copyright (C) 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 following conditions are
met:
1. Redistributions of source code must retain the... | apyrgio/snf-ganeti | src/rpc-test.hs | Haskell | bsd-2-clause | 9,085 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{- |
Module : Kiosk.Backend.Data.ReportTemplateSpec
Description : Tests for Report Generation
Copyright : Plow Technologies LLC
License : MIT License
Maintainer : Scott ... | plow-technologies/cobalt-kiosk-data-template | test/Kiosk/Backend/Data/ReportTemplateSpec.hs | Haskell | bsd-3-clause | 17,251 |
-- Copyright (c) 2017, Travis Bemann
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- o Redistributions of source code must retain the above copyright notice, this
-- list of conditio... | tabemann/botwars | src/Main.hs | Haskell | bsd-3-clause | 22,547 |
----------------------------------------------------------------------------
-- |
-- Module : Imported1
-- Copyright : (c) Sergey Vinokurov 2015
-- License : BSD3-style (see LICENSE)
-- Maintainer : serg.foo@gmail.com
----------------------------------------------------------------------------
{-# LANG... | sergv/tags-server | test-data/0001module_with_imports/Imported1.hs | Haskell | bsd-3-clause | 482 |
module OpenSet where
import Data.List hiding (union)
import Data.Set as Set
dup x = (x, x)
openSets :: Ord a => [a] -> [[[a]]]
openSets x = toList $ Set.map (toList.(Set.map toList)) $ Set.filter isOpen candidates
where
(e, u) = (fromList [], fromList x)
conpact = fromList [e, u]
candidat... | cutsea110/aop | src/OpenSet.hs | Haskell | bsd-3-clause | 790 |
module Rules.Eq where
import Derivation
import Goal
import Rules.Utils
import Tactic
import Term
-- H >> (a = b in A) = (a' = b' in A') in U(i)
-- H >> A = A' in U(i)
-- H >> a = a' in A
-- H >> b = b' in A'
-- Uses: EQ_EQ
eqEQ :: PrlTactic
eqEQ (Goal ctx t) =
case t of
Eq (Eq m1 n1 a1) (Eq m2 n2 a2... | thsutton/cha | lib/Rules/Eq.hs | Haskell | bsd-3-clause | 2,365 |
{-# LANGUAGE FlexibleContexts #-}
module Language.Lambda.Semantics.Named.BigStep.Tests
(
bigStepTests
) where
import Prelude hiding (fromInteger, toInteger)
import Data.Char
import Bound.Unwrap as BU
import Test.Tasty
import qualified Test.Tasty.QuickCheck as QC
import qualified Test.Tasty.SmallCheck ... | julmue/UntypedLambda | test/Language/Lambda/Semantics/Named/BigStep/Tests.hs | Haskell | bsd-3-clause | 11,361 |
--------------------------------------------------------------------------------
-- |
-- Module : Sequence.Location
-- Copyright : (c) [2009..2010] Trevor L. McDonell
-- License : BSD
--
-- Locate sequences fragments from index keys
--
-------------------------------------------------------------------------------... | tmcdonell/hfx | src/haskell/Sequence/Location.hs | Haskell | bsd-3-clause | 1,869 |
module Playground01 where
import Data.List
simple :: t -> t
simple x = x
calcChange :: (Num t, Ord t) => t -> t -> t
calcChange owed given = if change > 0
then change
else 0
where change = given - owed
doublePlusTwo :: Num t => ... | stefanocerruti/haskell-primer-alpha | src/Playground01.hs | Haskell | bsd-3-clause | 5,208 |
-- |
-- Module : Network.Machine.Protocol.SMTP
-- Copyright : Lodvær 2015
-- License : BSD3
--
-- Maintainer : Lodvær <lodvaer@gmail.com>
-- Stability : provisional
-- Portability : unknown
--
-- SMTP machines.
module Network.Machine.Protocol.SMTP where
-- TODO
| lodvaer/machines-network | src/Network/Machine/Protocol/SMTP.hs | Haskell | bsd-3-clause | 285 |
module Paths_simple (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
catchIO :: IO a -> (Exception.IOException -> IO a) ->... | Chuck-Aguilar/haskell-opencv-work | .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/autogen/Paths_simple.hs | Haskell | bsd-3-clause | 1,617 |
{-# LANGUAGE ForeignFunctionInterface #-}
module Network.UV
( Loop
, defaultLoop
, createLoop
, run
) where
import Foreign.C
import Foreign.Ptr
import Network.UV.TCP
import Network.UV.Internal.UV
foreign import ccall unsafe "uv_loop_new" c_uv_loop_new
:: IO (Ptr a)
foreign... | aardvarrk/hlibuv | src/Network/UV.hs | Haskell | bsd-3-clause | 835 |
-- | Allows the abstract syntax tree to be compiled into C++ template
-- metaprogram.
module Compiler.Compile
(
-- * Module compiling
compileModule
, compileTopLevel
-- * Top level entities compiling
, compileType
, compileDataDef
, compileValDef
-- * Expression compiling
,... | vituscze/norri | src/Compiler/Compile.hs | Haskell | bsd-3-clause | 10,491 |
{-# LANGUAGE
DeriveGeneric
, OverloadedStrings
#-}
module Lib where
import Control.Monad
import Data.Aeson
import qualified Data.ByteString.Lazy.Char8 as BL
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Data.Yaml
import GHC.Generics
import Network.Nats
import System.Exit
imp... | wayofthepie/cspawn | src/Lib.hs | Haskell | bsd-3-clause | 2,119 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE... | anchor/retcon | lib/Retcon/Network/Server.hs | Haskell | bsd-3-clause | 21,317 |
-- File created: 2009-07-21 13:19:42
module Main (main, runOne) where
import Prelude hiding (catch)
import Control.Exception (catch)
import Data.IORef (newIORef, readIORef)
import System.Environment (getArgs)
import Haschoo.Running (runRepl, runFile, run, RunError)
import Haschoo.Stdlib (toplevelContext)
... | Deewiant/haschoo | Haschoo/Main.hs | Haskell | bsd-3-clause | 821 |
{-
(c) The University of Glasgow 2006
(c) The University of Glasgow, 1997-2006
Buffers for scanning string input stored in external arrays.
-}
{-# LANGUAGE BangPatterns, CPP, MagicHash, UnboxedTuples #-}
{-# OPTIONS_GHC -O2 #-}
-- We always optimise this, otherwise performance of a non-optimised
-- compiler is sever... | ezyang/ghc | compiler/utils/StringBuffer.hs | Haskell | bsd-3-clause | 12,130 |
module Network.EasyBitcoin.Internal.CurveConstants
where
-- SECP256k1 curve parameters
pairG :: (Integer, Integer)
pairG = ( 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
, 0X483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
)
curveP :: Integer
cur... | vwwv/easy-bitcoin | Network/EasyBitcoin/Internal/CurveConstants.hs | Haskell | bsd-3-clause | 573 |
{-# LANGUAGE EmptyDataDecls #-}
module TypeLevel.Number.Nat.Types ( I
, O
, Z
) where
-- | One bit.
data I n
-- | Zero bit.
data O n
-- | Bit stream terminator.
data Z
| Shimuuar/type-level-numbers | TypeLevel/Number/Nat/Types.hs | Haskell | bsd-3-clause | 271 |
factors :: Int -> [Int]
factors n = [x | x <- [1..n], mod n x == 0]
prime :: Int -> Bool
prime x = factors x == [1, x]
main :: IO ()
main = print . sum $ take 1000 [x | x <- 2 : [3, 5..], prime x]
| nikai3d/ce-challenges | easy/sum_prime.hs | Haskell | bsd-3-clause | 201 |
{-# LANGUAGE OverloadedStrings #-}
module Hakyll.Web.Urls.Relativize.Tests
( tests
) where
import Test.Framework
import Test.HUnit hiding (Test)
import Hakyll.Web.Urls.Relativize
import TestSuite.Util
tests :: [Test]
tests = fromAssertions "relativizeUrls"
[ "<a href=\"../foo\">bar</a>" @=?
relat... | sol/hakyll | tests/Hakyll/Web/Urls/Relativize/Tests.hs | Haskell | bsd-3-clause | 935 |
{-# LANGUAGE GADTs, DataKinds, KindSignatures #-}
import Data.Map.Strict (Map)
data Protocol = Protocol
{ pEndpoints :: [Endpoint]
, pVersion :: String
}
data Endpoint = Endpoint
{ eUrl :: String
, eTransmissions :: Map Method Transmission
}
data Method = GET | POST | OPTIONS | HE... | MaximilianAlgehed/Haspec | src/Lang/Lang.hs | Haskell | bsd-3-clause | 2,310 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
#ifdef TRUSTWORTHY
{-# LANGUAGE Trustworthy #-}
#endif
-------------------------------------------------------------------------------
-- |
-- Module : Data.Vector.Lens
-- Copyright : (C) 2... | np/lens | src/Data/Vector/Lens.hs | Haskell | bsd-3-clause | 4,796 |
{-# LANGUAGE OverloadedStrings #-}
module Block
( blockSpecs
) where
import Test.Hspec
import Data.Text (Text)
import Data.Conduit
import qualified Data.Conduit.List as CL
import Text.Markdown (def, MarkdownSettings(..))
import Text.Markdown.Block
import Data.Functor.Identity (runIdentity)
checkWith :: Markdow... | thefalconfeat/markdown | test/Block.hs | Haskell | bsd-3-clause | 3,651 |
z = (x, y)
where x = [ n * n
| n <- [1..]
, odd n
, isPrime n ]
y = [ n * n
| n <- [1..]
, even n
, isPrime (n `div` 2) ]
| itchyny/vim-haskell-indent | test/list/comprehension_multi_line2.out.hs | Haskell | mit | 216 |
{-# 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 #-}
-------------------... | chjp2046/fbthrift | thrift/compiler/test/fixtures/service-fuzzer/gen-hs/TestService_Iface.hs | Haskell | apache-2.0 | 1,942 |
{-# Language RankNTypes #-}
{-# Language TypeOperators #-}
{-# Language BangPatterns #-}
module IO where
-- import Data.Array
import Prelude hiding (traverse)
import Data.Vector.Unboxed hiding (force)
import qualified Data.Vector.Unboxed as V
import Data.Array.Repa
import Types
import System.CPUTime
import Data.Array... | robstewart57/small-image-processing-dsl-implementations | haskell/small-image-processing-dsl/src/IO.hs | Haskell | bsd-3-clause | 4,421 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
-- | Clean a project.
module Stack.Clean
(clean
,CleanOpts(..)
,StackCleanException(..)
) where
import Control.Exception (Exception)
import Control.Monad.Catch (throwM)
import ... | mrkkrp/stack | src/Stack/Clean.hs | Haskell | bsd-3-clause | 2,851 |
{-
(c) Rahul Muttineni 2016-2017
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
Loading interface files
-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module ETA.Iface.LoadIface (
-- Importing one thing
tcLookupImported_maybe, importDecl,
... | pparkkin/eta | compiler/ETA/Iface/LoadIface.hs | Haskell | bsd-3-clause | 47,743 |
{-# LANGUAGE OverloadedStrings #-}
import Text.XML.Expat.Tree
import Control.Monad
import Data.Text (Text)
import qualified Data.Text as T
import Data.ByteString (ByteString)
import qualified Data.ByteString.Lazy as L
import Data.Maybe
main :: IO ()
main = do
bs <- L.readFile "ROADS.xml"
let Element _ _ chs =... | sol/hexpat | test/test2.hs | Haskell | bsd-3-clause | 570 |
{-# LANGUAGE NoRebindableSyntax #-}
-- | This file contains the template haskell code for deriving SubHask class instances from Base instances.
-- All of the standard instances are created in "SubHask.Compatibility.Base".
-- This module is exported so that you can easily make instances for your own types without any e... | abailly/subhask | src/SubHask/TemplateHaskell/Base.hs | Haskell | bsd-3-clause | 8,576 |
{-# LANGUAGE BangPatterns, CPP, RecordWildCards, GADTs #-}
module CmmLayoutStack (
cmmLayoutStack, setInfoTableStackMap
) where
import GhcPrelude hiding ((<*>))
import StgCmmUtils ( callerSaveVolatileRegs ) -- XXX layering violation
import StgCmmForeign ( saveThreadState, loadThreadState ) -- XXX lay... | ezyang/ghc | compiler/cmm/CmmLayoutStack.hs | Haskell | bsd-3-clause | 47,277 |
-- |
-- Module : Network.TLS.X509
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : experimental
-- Portability : unknown
--
-- X509 helpers
--
module Network.TLS.X509
( CertificateChain(..)
, Certificate(..)
, SignedCertificate
, getCertificate
, ... | beni55/hs-tls | core/Network/TLS/X509.hs | Haskell | bsd-3-clause | 1,995 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Ord
-- Copyright : (c) The University of Glasgow 2005
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libr... | frantisekfarka/ghc-dsi | libraries/base/Data/Ord.hs | Haskell | bsd-3-clause | 1,568 |
<?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="sl-SI">
<title>Passive Scan Rules | ZAP Extension</title>
<maps>
<homeID>top</homeID>
... | ccgreen13/zap-extensions | src/org/zaproxy/zap/extension/pscanrules/resources/help_sl_SI/helpset_sl_SI.hs | Haskell | apache-2.0 | 980 |
{-# LANGUAGE RankNTypes, TypeInType #-}
module T11640 where
import Data.Kind
data HEq :: forall k1. k1 -> forall k2. k2 -> Type where
| ezyang/ghc | testsuite/tests/polykinds/T11640.hs | Haskell | bsd-3-clause | 137 |
{-
(c) The AQUA Project, Glasgow University, 1993-1998
\section[SimplMonad]{The simplifier Monad}
-}
{-# LANGUAGE CPP #-}
module SimplEnv (
InId, InBind, InExpr, InAlt, InArg, InType, InBndr, InVar,
OutId, OutTyVar, OutBind, OutExpr, OutAlt, OutArg, OutType, OutBndr, OutVar,
InCoercion, OutCo... | urbanslug/ghc | compiler/simplCore/SimplEnv.hs | Haskell | bsd-3-clause | 27,858 |
{-# LANGUAGE DeriveDataTypeable #-}
module UnitTests.Options ( OptionShowSolverLog(..)
, OptionMtimeChangeDelay(..)
, extraOptions )
where
import Data.Proxy
import Data.Typeable
import Test.Tasty.Options
{------------------------------------------------------... | mydaum/cabal | cabal-install/tests/UnitTests/Options.hs | Haskell | bsd-3-clause | 1,399 |
{-# LANGUAGE TypeFamilies, LiberalTypeSynonyms #-}
-- ^ crucial for exercising the code paths to be
-- tested here
module ShouldCompile where
type family Element c :: *
f :: x -> Element x
f x = undefined
| forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/indexed-types/should_compile/Simple19.hs | Haskell | bsd-3-clause | 264 |
module Annfail12 where
-- Testing errors hidden in annotations
{-# ANN f (error "You were meant to see this error!" :: Int) #-}
f x = x | wxwxwwxxx/ghc | testsuite/tests/annotations/should_fail/annfail12.hs | Haskell | bsd-3-clause | 137 |
{-# LANGUAGE FlexibleInstances #-}
module Text.Pin ( Pin(..), tag, empty, simple, isSelf, fromName ) where
import Control.Applicative hiding ( many, (<|>), empty, optional )
import Control.Name
import Data.Either
import Data.List hiding ( find )
import Data.Set ( Set, fromList )
import Data.String.Utils ( strip )
impor... | Soares/tagwiki | src/Text/Pin.hs | Haskell | mit | 2,306 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE BangPatterns #-}
module Data.Frame.Types (
Val(..),
Type(..),
subsumes,
subsume,
like,
typeVal,
lub
) where
import Data.Data
-- import Data.DateTime
import Data.Text (Text, pack)
import Data.Frame.Internal (Default(..))
import Control.DeepSeq (NFData(..)... | houshuang/frame | src/Data/Frame/Types.hs | Haskell | mit | 3,994 |
module TypeClient where
-- Can't refer to modules named Type
-- Should rename the module
import Type
g :: Int
g = Type.id 3
| antalsz/hs-to-coq | examples/base-tests/TypeClient.hs | Haskell | mit | 126 |
{-# LANGUAGE DeriveGeneric #-}
module SimpleDecree (
IntegerOperation(..)
)
where
-- local imports
import Control.Consensus.Paxos
-- external imports
import qualified Data.Serialize as C
import GHC.Generics
--------------------------------------------------------------------------------
---------------------... | hargettp/paxos | tests/SimpleDecree.hs | Haskell | mit | 654 |
module Type(
Type(..)
)where
import Definition
data Type = Polymorphism | TypeAlias Identifier Identifier | TypeArray Type Int | Type Identifier Int deriving (Eq)
instance Show Type where
show Polymorphism = "?Type?"
show (Type n i) = n ++ replicate i '*'
| sqd/haskell-C89-interpreter | Type.hs | Haskell | mit | 267 |
-----------------------------------------------------------
-- |
-- module: MXNet.Core.Base.Internal.TH.Symbol
-- copyright: (c) 2016 Tao He
-- license: MIT
-- maintainer: sighingnow@gmail.com
--
-- Functions about Symbol that generated by temp... | sighingnow/mxnet-haskell | mxnet/src/MXNet/Core/Base/Internal/TH/Symbol.hs | Haskell | mit | 1,228 |
module Y2017.M02.D20.Solution where
import Control.Arrow ((&&&))
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Monoid
import Data.Ratio
-- below imports available via 1HaskellADay git repository
import Control.Logic.Frege (adjoin)
import qualified Data.Bag as Bag
import Data.Percentage
import R... | geophf/1HaskellADay | exercises/HAD/Y2017/M02/D20/Solution.hs | Haskell | mit | 2,231 |
{-# LANGUAGE FlexibleContexts #-}
module Rx.Notification where
import Rx.Observable.Types
getValue :: Notification v -> Maybe v
getValue (OnNext v) = Just v
getValue _ = Nothing
hasThrowable :: Notification v -> Bool
hasThrowable (OnError _) = True
hasThrowable _ = False
accept :: Notification v -> Observer v -> IO... | roman/Haskell-Reactive-Extensions | rx-core/src/Rx/Notification.hs | Haskell | mit | 394 |
{-# LANGUAGE RecordWildCards #-}
import Data.Foldable (for_)
import Test.Hspec (Spec, describe, it, shouldBe)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import Base (Error(..), rebase)
main :: IO ()
main = hspecWith defaultConfig {configFastFail = True} specs
specs :: Spec
specs ... | exercism/xhaskell | exercises/practice/all-your-base/test/Tests.hs | Haskell | mit | 5,933 |
import Test.HUnit
import Q33
test1 = TestCase (assertEqual "tryCoPrime 0 15 should be Right Zero is not supported." (Right "Zero is not supported") (tryCoPrime 0 15))
test2 = TestCase (assertEqual "tryCoPrime 15 0 should be Right Zero is not supported." (Right "Zero is not supported") (tryCoPrime 15 0 ))
test3 = Te... | cshung/MiscLab | Haskell99/q33.test.hs | Haskell | mit | 644 |
module Ch15.MadLibs where
import Data.Monoid
type Verb = String
type Adjective = String
type Adverb = String
type Noun = String
type Exclamation = String
madlib :: Exclamation -> Adverb -> Noun -> Adjective -> String
madlib e adv noun adj =
e <> "! he said " <>
adv <> " as he jumped into his car " <>
noun <> "... | andrewMacmurray/haskell-book-solutions | src/ch15/MadLibs.hs | Haskell | mit | 606 |
module Slack where
import ClassyPrelude
import Control.Monad (mfilter)
import Control.Monad.Except (ExceptT(ExceptT))
import Control.Lens (Getter, Prism', prism', view, to)
import Control.Lens.TH (makeLenses, makePrisms)
import Data.Aeson ((.=), Value(Number,... | Dridus/alexandria | server/Slack.hs | Haskell | mit | 37,892 |
{-# LANGUAGE TypeApplications, ScopedTypeVariables, LambdaCase,
ViewPatterns, RecordWildCards,
AllowAmbiguousTypes, GADTs, TypeFamilies, KindSignatures, DataKinds,
TemplateHaskell #-}
module PrintModGuts (
-- *Pieces of 'ModGuts' for printing
ModGutsInfo(..), fullInfo, summar... | antalsz/hs-to-coq | structural-isomorphism-plugin/src/PrintModGuts.hs | Haskell | mit | 15,062 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Batch.Parser
(
parse
, command
, Script
, Command (..)
, Expression (..)
) where
import Batch.Definitions
import Batch.Lexer
import Control.Applicative
import Con... | danstiner/transpiler | src/Batch/Parser.hs | Haskell | mit | 4,947 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appstream-imagebuilder-domainjoininfo.html
module Stratosphere.ResourceProperties.AppStreamImageBuilderDomain... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/AppStreamImageBuilderDomainJoinInfo.hs | Haskell | mit | 2,522 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisanalyticsv2-applicationreferencedatasource-jsonmappingparameters.html
module Stratosphere.ResourceProp... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/KinesisAnalyticsV2ApplicationReferenceDataSourceJSONMappingParameters.hs | Haskell | mit | 2,477 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Custom.Codegen where
import Data.Word
import Data.String
import Data.List
import Data.Function
import qualified Data.Map as Map
import Control.Monad.State
import Control.Applicative
import LLVM.General.AST
import LLVM.General.AST.... | eigengo/hwsexp | core/main/Custom/Codegen.hs | Haskell | apache-2.0 | 8,731 |
module Synthax.Lexer
( names
, opNames
, symbol
, identifier
, reserved
, reservedOp
, parens
, integer
, float
, semiSep1
) where
import Prelude
import Text.Parsec
import qualified Text.Parsec.Token as Token
import Text.Parsec.Language
import Text.Parsec.String
names :: [String]
names = words "Source Code Module Gai... | burz/sonada | Synthax/Lexer.hs | Haskell | apache-2.0 | 1,211 |
v = [1, 5, 10, 50, 100, 500 ]
acm [] [] = 0
acm (a:as) (b:bs) = (a*b) + acm as bs
ans i v =
let a = acm i v
in
if a >= 1000
then 1
else 0
main = do
l <- getLine
let i = map read $ words l :: [Int]
o = ans i v
print o
| a143753/AOJ | 0296.hs | Haskell | apache-2.0 | 255 |
{-# LANGUAGE FlexibleContexts, ScopedTypeVariables, CPP #-}
{-| Utility functions. -}
{-
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 following conditions are
met:
1. Redi... | ganeti/ganeti | src/Ganeti/Utils.hs | Haskell | bsd-2-clause | 30,303 |
module Shader where
import Graphics.GL
import Control.Monad
import Control.Monad.Trans
import Foreign
import Foreign.C.String
import qualified Data.ByteString as BS
import qualified Data.Text.Encoding as Text
import qualified Data.Text.IO as Text
import Linear
import Data.Foldable
newtype GLProgram = GLPr... | lukexi/halive | demo/Shader.hs | Haskell | bsd-2-clause | 4,741 |
module Blockchain.Data.Wire (
Message(..),
Capability(..),
obj2WireMessage,
wireMessage2Obj
) where
import Data.Functor
import Data.List
import Data.Word
import Network.Haskoin.Crypto
import Numeric
import Text.PrettyPrint.ANSI.Leijen hiding ((<$>))
import qualified Blockchain.Colors as CL
import Blockchai... | kejace/ethereum-client-haskell | src/Blockchain/Data/Wire.hs | Haskell | bsd-3-clause | 9,629 |
{-# LANGUAGE ScopedTypeVariables #-}
-- | Provides common combinators for concurrency in Javascript.
--
-- The emulated threading Javascript threading model provided by
-- Sunroof is based on cooperative multithreading
-- (since Javascript is not multithreaded).
module Language.Sunroof.Concurrent
( loop
, fo... | ku-fpg/sunroof-compiler | Language/Sunroof/Concurrent.hs | Haskell | bsd-3-clause | 1,754 |
module Graph where
import qualified Data.Map as Map
import qualified Data.Set as Set
-- | The type of graph whose vertices are of type n.
type Graph n = Map.Map n (Set.Set n)
empty :: Graph n
empty = Map.empty
union :: (Eq n, Ord n) => Graph n -> Graph n -> Graph n
union i1 i2 = Map.unionWith Set.union i1 i2
cliq... | koba-e964/hayashii-mcc | Graph.hs | Haskell | bsd-3-clause | 1,043 |
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
{-# LANGUAGE ScopedTypeVariables, ExistentialQuantification, RankNTypes, OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.Taffybar.Widget.Workspaces
-- Copyright : (c) Ivan A. Malison
-- License... | teleshoes/taffybar | src/System/Taffybar/Widget/Workspaces.hs | Haskell | bsd-3-clause | 32,155 |
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances,
BangPatterns, ConstraintKinds #-}
module Numeric.DSDE.SDESolver where
import Numeric.DSDE.SDE.GeometricBrownian
import Numeric.DSDE.RNG
import Numeric.DSDE.SDE
import qualified System.Random.MWC as M
-- | The Euler-Maruyama sol... | davnils/sde-solver | src/Numeric/DSDE/SDESolver.hs | Haskell | bsd-3-clause | 1,664 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.