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 Examples.Language.MicroKanren where import Language.MicroKanren import Numeric.Natural q5 :: Goal Natural q5 = callFresh $ \q -> Variable q === Term 5 aAndB :: Goal Natural aAndB = conj (callFresh $ \a -> Variable a === Term 7) (callFresh $ \b -> disj (Variable b === Term 5) ...
joneshf/MicroKanren
examples/Examples/Language/MicroKanren.hs
Haskell
bsd-3-clause
1,172
{-# LANGUAGE TemplateHaskell #-} module Main where import Control.Exception.IOChoice.TH import Control.Exception (|||>) :: IO a -> IO a -> IO a (|||>) = $(newIOChoice [''ErrorCall, ''ArithException]) main :: IO () main = do a0 <- evaluate (1 `div` 0) |||> return 3 putStrLn $ "Should be 3: " ++ show a0 a1 <- ...
kazu-yamamoto/io-choice
examples/derive-test.hs
Haskell
bsd-3-clause
669
{-# LANGUAGE CPP #-} -- | -- Module: Data.Aeson -- Copyright: (c) 2011, 2012 Bryan O'Sullivan -- (c) 2011 MailRank, Inc. -- License: Apache -- Maintainer: Bryan O'Sullivan <bos@serpentine.com> -- Stability: experimental -- Portability: portable -- -- Types and functions for working efficient...
moonKimura/aeson-0.6.2.1
Data/Aeson.hs
Haskell
bsd-3-clause
12,627
{-# LANGUAGE ScopedTypeVariables, CPP, BangPatterns, RankNTypes #-} #if __GLASGOW_HASKELL__ == 700 -- This is needed as a workaround for an old bug in GHC 7.0.1 (Trac #4498) {-# LANGUAGE MonoPatBinds #-} #endif #if __GLASGOW_HASKELL__ >= 703 {-# LANGUAGE Unsafe #-} #endif {-# OPTIONS_HADDOCK not-home #-} -- | Copyright...
CloudI/CloudI
src/api/haskell/external/bytestring-0.10.10.0/Data/ByteString/Builder/Internal.hs
Haskell
mit
43,928
module Main where import Test.MiniUnitTest main :: IO () main = tests
bagl/takusen-oracle
Test/Main.hs
Haskell
bsd-3-clause
80
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-} {-| Binary instances for the core datatypes -} module Idris.Core.Binary where import Control.Applicative ((<*>), (<$>)) import Control.Monad (liftM2) import Control.DeepSeq (($!!)) import Data.Binary import Data.Vector.Binary import qualified Data.Text as T import quali...
Enamex/Idris-dev
src/Idris/Core/Binary.hs
Haskell
bsd-3-clause
25,367
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} module DB where import Data.SafeCopy import Servant.Server.Auth.Token.Acid.Schema as A -- | Application global state for acid-state data DB = DB { dbAuth :: A.Model -- ^ Storage for Auth state , dbCustom :: () -- ^ Demo of custom state } -- | Generation of inita...
ivan-m/servant-auth-token
example/acid/src/DB.hs
Haskell
bsd-3-clause
594
{-# LANGUAGE DoRec #-} -- | Make sure this program runs without leaking memory import FRP.Sodium import Control.Applicative import Control.Exception import System.Timeout data Source = Source { unSource :: Reactive (Behaviour (Int, Int), Event Source) } verbose = False main = do (et, pushT) <- sync $ newEvent ...
kevintvh/sodium
haskell/examples/tests/memory-test-2.hs
Haskell
bsd-3-clause
1,162
{-# LANGUAGE BangPatterns #-} import System.Directory import System.FilePath import Control.Concurrent.Async import System.Environment import Data.List hiding (find) import Control.Exception (finally) import Data.Maybe (isJust) import Control.Concurrent.MVar import Data.IORef import GHC.Conc (getNumCapabilities) -- <<...
prt2121/haskell-practice
parconc/findpar2.hs
Haskell
apache-2.0
2,127
module PackageTests.PreProcess.Check (suite) where import PackageTests.PackageTester (PackageSpec(..), SuiteConfig, assertBuildSucceeded, cabal_build) import System.FilePath import Test.Tasty.HUnit suite :: SuiteConfig -> Assertion suite config = do let spec = PackageSpec { directory = "PackageTes...
enolan/cabal
Cabal/tests/PackageTests/PreProcess/Check.hs
Haskell
bsd-3-clause
527
{-# LANGUAGE PolyKinds, GADTs #-} module T7328 where data Proxy a class Foo a where foo :: a ~ f i => Proxy (Foo f)
ghc-android/ghc
testsuite/tests/polykinds/T7328.hs
Haskell
bsd-3-clause
123
{-# LANGUAGE QuasiQuotes, TemplateHaskell, CPP, GADTs, TypeFamilies, OverloadedStrings, FlexibleContexts, EmptyDataDecls, FlexibleInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses #-} module PersistUniqueTest where import Init -- mpsGeneric = False is due to a bug or at least lack of a feature in mkKeyType...
psibi/persistent
persistent-test/src/PersistUniqueTest.hs
Haskell
mit
1,271
{-# LANGUAGE ScopedTypeVariables, Rank2Types #-} -- -- (c) The University of Glasgow 2002-2006 -- -- Serialized values module GHCJS.Prim.TH.Serialized ( Serialized , fromSerialized , toSerialized , serializeWithData ...
forked-upstream-packages-for-ghcjs/ghcjs
ghcjs-prim/src/GHCJS/Prim/TH/Serialized.hs
Haskell
mit
7,315
{-# LANGUAGE StandaloneDeriving, UndecidableInstances #-} module Data.Term.Types where import Data.Binding import Data.Name import Data.Typing import qualified Data.Map as Map import qualified Data.Set as Set type Result a = Either String a type Context term = Map.Map Name term type Inferer term = Context term -> R...
antitypical/Surface
src/Data/Term/Types.hs
Haskell
mit
1,752
-- Conduit -- ref: https://wiki.haskell.org/Conduit -- conduit-lib: https://www.schoolofhaskell.com/user/snoyberg/library-documentation/conduit-overview {- Streaming data library Collection of libraries that share the same underlying data structures Alternative to lazy I/O Promises: dete...
Airtnp/Freshman_Simple_Haskell_Lib
Idioms/Conduit.hs
Haskell
mit
1,278
-- | Settings are centralized, as much as possible, into this file. This -- includes database connection settings, static file locations, etc. -- In addition, you can configure a number of different aspects of Yesod -- by overriding methods in the Yesod typeclass. That instance is -- declared in the Foundation.hs file....
fpco/schoolofhaskell.com
src/Settings.hs
Haskell
mit
1,468
{-# LANGUAGE DeriveDataTypeable #-} -- | Strings normalized according to Normalization Form Compatibility -- Decomposition. module Data.Text.Normal.NFKD ( Normal, fromText, toText ) where import Control.Arrow (first) import Control.DeepSeq import Data.Data import Data.Monoid import Data.String import Data.Tex...
pikajude/text-normal
src/Data/Text/Normal/NFKD.hs
Haskell
mit
1,226
{-# LANGUAGE DataKinds, FlexibleContexts, TypeOperators #-} module Geometry where import Control.Applicative import Data.Foldable (fold, foldMap) import Data.Vinyl import Graphics.GLUtil import Graphics.Rendering.OpenGL hiding (normal, normalize, light, Normal, Color) import Linear import Graphics.VinylGL import System...
spetz911/progames
vinyl-gl-master/examples/src/Geometry.hs
Haskell
mit
4,209
module Classifier ( Classifier(..), Metadata(..), StoredClassifier(..), buildClassifier, classifySequence, classifySequenceMulti, classifySequenceAll, leafOTU) where import Data.Tree import qualified Data.Map.Strict as M import qualified Data.List as L import Data.Binary (Binary, put, g...
tjunier/mlgsc
src/Classifier.hs
Haskell
mit
10,879
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} -- | SWF Decider logic. -- module Network.AWS.Wolf.Decide ( decide , decideMain ) where import Data.Aeson import Data.Time import Data.UUID import Data.UUID.V4 import Network.AWS.SWF import Network.AWS.Wolf....
swift-nav/wolf
src/Network/AWS/Wolf/Decide.hs
Haskell
mit
4,107
-- Copyright (c) 2011 Alexander Poluektov (alexander.poluektov@gmail.com) -- -- Use, modification and distribution are subject to the MIT license -- (See accompanyung file MIT-LICENSE) import Distribution.Simple main = defaultMain
apoluektov/domino
Setup.hs
Haskell
mit
232
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE CPP #-} module GenTM5Data ( instantiateDoc ) where import Data.Aeson import Data.Aeson.TH import Data.Text (Text) import qualified Data.Text as T import Data.HashMap.Strict (HashMap) import qualified ...
range12/there-is-no-B-side
tools/generators/GuestEncoder/GenTM5Data.hs
Haskell
mit
15,569
{-| Module : Collapse Description : Collapses all multi-clause functions into single-body ones -} module Latro.Collapse where import Control.Monad.Except import Latro.Ast import Latro.Compiler import Latro.Errors collectFunDefs :: RawId -> [RawAst Exp] -> ([RawAst FunDef], [RawAst Exp]) collectFunDefs _ [] = ([...
Zoetermeer/latro
src/Latro/Collapse.hs
Haskell
mit
3,533
-- Copyright (C) 2013 Jorge Aparicio import Data.Maybe (mapMaybe) main :: IO() main = print . head . filter isPalindrome . mapMaybe fst $ iterate next (Nothing, nums) where nums = [[x * y | y <- [x,x-1..start]] | x <- [end,end-1..start]] start = 100 :: Int end = 999 next :: Integral...
japaric/eulermark
problems/0/0/4/004.hs
Haskell
mit
669
-- SYNTAX TEST "source.haskell" module Intro where -- <- keyword.other -- ^^^^^ support.other.module -- ^^^^^ keyword.other -- ^^^^^^^^^^^^^^^ meta.declaration.module import Language.Haskell.Liquid.Prelude (liquidAssert) -- ^^^^^^^^^^^^ meta.declaration.exports enti...
atom-haskell/language-haskell
spec/fixture/liquidhaskell.hs
Haskell
mit
3,345
class YesNo a where yesno :: a -> Bool instance YesNo Int where yesno 0 = False yesno _ = True instance YesNo [a] where yesno [] = False yesno _ = True instance YesNo Bool where yesno = id instance YesNo (Maybe a) where yesno Nothing = False yesno (Just _) = True yesnoIf :: (YesNo...
NickAger/LearningHaskell
CIS194/typeclassexperiments.hs
Haskell
mit
576
-- matricula 1 a00368770 -- matricula 2 a01273613 -- Problema 1 promedio de alumnos -- funcion que regresa el promedio de los alumnos promedio :: Integer -> [(Integer, [Char], [Double])] -> [(Integer, [Double])] promedio _ [] = [( "", [0.0])] -- caso base -- obtener el promedio promedio mat1 ((mat2, _, parcialista) :...
JorgeRubio96/LenguajesdeProgramacion
a00368770_a01273613_ejercicio13.hs
Haskell
mit
1,058
-- A letra grega λ ́e substitu ́ıda pela contrabarra “\”; -- O ponto “.” ́e substitu ́ıdo por ->. -- Por exemplo, λx.x 2 ́e notado, em Haskell como: \x->x^2 ou, ainda, \x->x*x. quad = \x->x*x expr = \x->x^2+2*x+3 raiz = \x->(sqrt x) map (f x = x*x) [1..10] -- <interactive>:1:9: parse error on input ‘=’ map (\x-...
tonussi/freezing-dubstep
pratica-03/Intro.hs
Haskell
mit
783
{-# LANGUAGE ScopedTypeVariables #-} -- allows "forall t. Moment t" import Network.Socket import System.IO import System.Exit import Control.Concurrent import Control.Monad import Data.Maybe import Data.Word import qualified Data.Map.Strict as Map import Graphics.UI.Gtk as Gtk hiding (Event) import Graphics.UI.Gtk.Bu...
dbanerjee1979/dirc
Dirc.hs
Haskell
mit
7,122
{- see Chapter 17 of the Haskell 2010 Language Report -} module Data.Complex where
evilcandybag/JSHC
hslib/Data/Complex.hs
Haskell
mit
86
{-# LANGUAGE OverloadedStrings #-} module Main (main) where import Network.JsonRpc.Server import System.IO (BufferMode (LineBuffering), hSetBuffering, stdout) import qualified Data.ByteString.Lazy.Char8 as B import Data.List (intercalate) import Data.Maybe (fromMaybe) import Control.Monad (forM_, when) import Control...
grayjay/json-rpc-server
demo/Demo.hs
Haskell
mit
1,690
sommeDeXaY x y = if x > y then 0 else x + sommeDeXaY (x+1) y somme :: [Int] -> Int somme [] = 0 somme (x:xs) = x + somme xs last' :: [a] -> a last' xs = head (reverse xs) init' :: [a] -> [a] init' xs = reverse (tail (reverse xs)) -- Function !! (!!!) :: [a] -> Int -> a (!!!) [] n = error "Index too large" (!!!) (...
Debaerdm/L3-MIAGE
Programmation Fonctionnel/TP/TP1/sommeDeXaY.hs
Haskell
mit
594
module Lycopene.ApplicationSpec (spec) where import Test.Hspec import Test.QuickCheck import Lycopene.SpecTool import qualified Lycopene.Core as Core spec :: Spec spec = do before localEngine $ do describe "Event" $ do it "create a project" $ \engine -> do cr...
utky/lycopene
tests/Lycopene/ApplicationSpec.hs
Haskell
apache-2.0
1,633
-- |Constraints that specify a control flow analysis for Javascript. module Ovid.Constraints ( initialize , stmt , expr , AnnotatedStatement , AnnotatedExpression , ParentNodeT , JsCFAState(..) , CFAOpts (..) ) where -- #define CONSERVATIVE_MODE -- #define DEBUG_XHR -- #define DEBUG_BUILTINS -- #de...
brownplt/ovid
src/Ovid/Constraints.hs
Haskell
bsd-2-clause
44,770
-- vim: sw=2: ts=2: set expandtab: {-# LANGUAGE CPP, TemplateHaskell, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, OverlappingInstances, IncoherentInstances, OverloadedStrings, GADTs, NoMonomorphismRes...
kyagrd/micronax
src/Unify.hs
Haskell
bsd-2-clause
5,110
{-# LANGUAGE OverloadedStrings #-} {-| Implementation of the Ganeti confd server functionality. -} {- Copyright (C) 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. Redistribution...
apyrgio/snf-ganeti
src/Ganeti/Monitoring/Server.hs
Haskell
bsd-2-clause
9,228
{- This is a module for reading and parsing *.csv files. -} module DataBuilder ( getData , filterDataContainer , getMatrixFromDataContainer , getMatrixFromNumContainer , NumContainer(..) , Header , DataContainer )where import Data.Char import Data.List.Split import System.IO import ...
kanes115/Regressions
src/DataBuilder.hs
Haskell
bsd-3-clause
4,048
{- - Hacq (c) 2013 NEC Laboratories America, Inc. All rights reserved. - - This file is part of Hacq. - Hacq is distributed under the 3-clause BSD license. - See the LICENSE file for more details. -} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-...
ti1024/hacq
src/Control/Monad/Quantum/ApproxSequence/Class.hs
Haskell
bsd-3-clause
1,776
{-# language CPP #-} -- | = Name -- -- VK_NV_framebuffer_mixed_samples - device extension -- -- == VK_NV_framebuffer_mixed_samples -- -- [__Name String__] -- @VK_NV_framebuffer_mixed_samples@ -- -- [__Extension Type__] -- Device extension -- -- [__Registered Extension Number__] -- 153 -- -- [__Revision__] -...
expipiplus1/vulkan
src/Vulkan/Extensions/VK_NV_framebuffer_mixed_samples.hs
Haskell
bsd-3-clause
20,822
{-# LANGUAGE RankNTypes #-} module Network.Mail.Locutoria.Cli.Keymap where import Control.Lens hiding (lens) import Data.Map (Map) import qualified Data.Map as Map import Data.Default (Default, def) import Graphics.Vty.Input (Key(..), Modifier(..)) import Network.Mai...
hallettj/locutoria
Network/Mail/Locutoria/Cli/Keymap.hs
Haskell
bsd-3-clause
2,183
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE CPP #-} -- | -- Module : Text.Syntax.Poly.Combinators -- Copyright : 2010-11 University of Marburg, 2012 Kei Hibino -- License : BSD3 -- -- Maintainer : ex8k.hibino@gmail.com -- Stability : experimental -- Portability : unknown -- -- This module contains com...
schernichkin/haskell-invertible-syntax-poly
src/Text/Syntax/Poly/Combinators.hs
Haskell
bsd-3-clause
6,253
{- (c) The AQUA Project, Glasgow University, 1994-1998 \section[TysPrim]{Wired-in knowledge about primitive types} -} {-# LANGUAGE CPP #-} -- | This module defines TyCons that can't be expressed in Haskell. -- They are all, therefore, wired-in TyCons. C.f module TysWiredIn module TysPrim( mkPrimTyConName...
mettekou/ghc
compiler/prelude/TysPrim.hs
Haskell
bsd-3-clause
41,385
----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Config -- Copyright : (c) David Himmelstrup 2005 -- License : BSD-like -- -- Maintainer : lemmih@gmail.com -- Stability : provisional -- Portability : portable -- -- Utilities for handl...
plumlife/cabal
cabal-install/Distribution/Client/Config.hs
Haskell
bsd-3-clause
38,871
{-# LANGUAGE BangPatterns #-} {-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-name-shadowing#-} -- This code is written by Pedro Vasconcelos for his implementation of -- Tzaar game: HsTzaar. I'm reproducing it here just to be able to -- compare the performance of his implementation with my own. -- -- Thanks to Pedro ...
sphynx/hamisado
AI/Algorithms/Tzaar.hs
Haskell
bsd-3-clause
4,094
{-# LANGUAGE ConstraintKinds, TypeFamilies #-} {- | App module defines types used by the Spock framework. -} module Guide.App where -- hvect import Data.HVect -- Spock import Web.Spock import Guide.Types.User (User) import Guide.Types.Session (GuideData) import Guide.ServerStuff (ServerState) -- | Type of connect...
aelve/hslibs
src/Guide/App.hs
Haskell
bsd-3-clause
1,314
{-# LANGUAGE OverloadedStrings #-} module ServerSpec (spec) where import Test.Hspec import Server main :: IO () main = hspec spec spec :: Spec spec = do describe "reqUri" $ do it "is Nothing for an invalid HTTP GET request" $ do reqUri "FOO" `shouldBe` Nothing it "is Nothing for a...
tripped/hlog
test/ServerSpec.hs
Haskell
bsd-3-clause
1,412
module Scheme.Eval ( eval, readEvalPrint, readEvalPrint', readEvalLines, readEvalLines' , primitiveEnv, primitives) where import Control.Monad import Data.Maybe import Data.IORef import Control.Monad.Error import Scheme.Types import System.IO import Scheme.Parser import Scheme.Eval.DynamicTypes import Scheme.E...
hucal/SCMinHS
Scheme/Eval.hs
Haskell
bsd-3-clause
7,024
module Test.Juggernaut.Api where import Juggernaut.Api main :: IO () main = putStrLn "hello"
markhibberd/juggernaut
tests/Test/Juggernaut/Api.hs
Haskell
bsd-3-clause
95
-- Both these functions should successfully simplify -- using the combine-identical-alternatives optimisation module T7360 where import Data.OldList as L data Foo = Foo1 | Foo2 | Foo3 !Int fun1 :: Foo -> () {-# NOINLINE fun1 #-} fun1 x = case x of Foo1 -> () Foo2 -> () ...
jstolarek/ghc
testsuite/tests/simplCore/should_compile/T7360.hs
Haskell
bsd-3-clause
515
module Data.TTask.Command.Update ( updateTaskStatus , updateStoryStatus , updateSprintStatus ) where import Control.Lens import Data.TTask.Types ------ -- Update status updateTaskStatus :: Id -> TStatusRecord -> Project -> Project updateTaskStatus i r pj = pj&task i%~ (\t -> t { _taskStatus = r `TStatu...
tokiwoousaka/ttask
src/Data/TTask/Command/Update.hs
Haskell
bsd-3-clause
686
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE...
juanpaucar/hadron
src/Hadron/Controller.hs
Haskell
bsd-3-clause
44,398
module Tests ( levelTest , bassVolumeTest , bassTimingTest ) where import Euterpea import Elements -- | A short piece of music for testing that each of the instruments is set up -- correctly, and that the levels are adjusted. Each instrument is played -- indivudally for a few bars, and then several r...
mzero/PlainChanges2
src/Tests.hs
Haskell
bsd-3-clause
4,269
{-| This module provides a function for computing the topological sort of a directed acyclic graph. -} module TopologicalSort ( topologicalSort ) where import Prelude hiding (replicate) import Data.Vector.Unboxed.Mutable import Control.Monad.RWS import Control.Monad import Control.Lens import Co...
alexisVallet/ag44-graph-algorithms
TopologicalSort.hs
Haskell
bsd-3-clause
1,957
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE RecordWildCards #-} module Auth...
zohl/servant-auth-hmac
example/server/AuthAPI.hs
Haskell
bsd-3-clause
3,178
-- | UPDATE operations on HD wallets module Cardano.Wallet.Kernel.DB.HdWallet.Update ( updateHdRoot , updateHdRootPassword , updateHdAccountName ) where import Universum import Cardano.Wallet.Kernel.DB.HdWallet import Cardano.Wallet.Kernel.DB.Util.AcidState import UTx...
input-output-hk/pos-haskell-prototype
wallet/src/Cardano/Wallet/Kernel/DB/HdWallet/Update.hs
Haskell
mit
1,433
import Control.Arrow import Distribution.PackageDescription import Distribution.Simple hiding (Module) import Distribution.Simple.LocalBuildInfo import Language.Preprocessor.Cpphs import System.FilePath import Text.XkbCommon.ParseDefines import Module import Utils sourceLoc :: FilePath sourceLoc = "./" main :: IO (...
tulcod/haskell-xkbcommon
Setup.hs
Haskell
mit
1,350
{-# LANGUAGE ScopedTypeVariables, FlexibleContexts, TypeFamilies, TypeSynonymInstances, FlexibleInstances, GADTs, RankNTypes, UndecidableInstances, TypeOperators #-} -- | This module provides types and functions for creating and manipulating -- control signals (ready and ack) associated with protocols. The 'Ack' s...
andygill/kansas-lava
Language/KansasLava/Protocols/Types.hs
Haskell
bsd-3-clause
2,962
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Building info tables. -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmLayout ( mkArgDescr, emitCall, emit...
spacekitteh/smcghc
compiler/codeGen/StgCmmLayout.hs
Haskell
bsd-3-clause
19,947
{-# LANGUAGE CPP,MagicHash,ScopedTypeVariables,FlexibleInstances,RankNTypes,TypeSynonymInstances,MultiParamTypeClasses,BangPatterns #-} -- | By Chris Kuklewicz, drawing heavily from binary and binary-strict, -- but all the bugs are my own. -- -- This file is under the usual BSD3 licence, copyright 2008. -- -- Modified ...
timjb/protocol-buffers
Text/ProtocolBuffers/Get.hs
Haskell
apache-2.0
38,206
-------------------------------------------------------------------------------- -- | -- Module : System.Taffybar.Widget.CPUMonitor -- Copyright : (c) José A. Romero L. -- License : BSD3-style (see LICENSE) -- -- Maintainer : José A. Romero L. <escherdragon@gmail.com> -- Stability : unstable -- Portabilit...
teleshoes/taffybar
src/System/Taffybar/Widget/CPUMonitor.hs
Haskell
bsd-3-clause
1,649
{-# LANGUAGE OverloadedStrings #-} module SearchRepos where import qualified Github.Search as Github import qualified Github.Data as Github import Control.Monad (forM,forM_) import Data.Maybe (fromMaybe) import Data.List (intercalate) import System.Environment (getArgs) import Text.Printf (printf) import Data.Time.Clo...
adarqui/github
samples/Search/SearchRepos.hs
Haskell
bsd-3-clause
2,058
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Code generation for foreign calls. -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmForeign ( cgForeignCall, loadThreadS...
frantisekfarka/ghc-dsi
compiler/codeGen/StgCmmForeign.hs
Haskell
bsd-3-clause
15,782
module Testsuite.Utils.Test ( Test, ($?), ($$?), TestS(..), summarise, TestM, execTestM, liftIO, runTest ) where import Test.QuickCheck import Test.QuickCheck.Batch import System.IO ( hFlush, stdout ) data Test = Test String Property | Group String [Test] ($?) :: Testable a => String -> a -> Test ...
dolio/vector
old-testsuite/Testsuite/Utils/Test.hs
Haskell
bsd-3-clause
3,761
<?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="fa-IR"> <title>Selenium add-on</title> <maps> <homeID>top</homeID> <mapref location="m...
msrader/zap-extensions
src/org/zaproxy/zap/extension/selenium/resources/help_fa_IR/helpset_fa_IR.hs
Haskell
apache-2.0
961
{-# LANGUAGE MagicHash, UnboxedTuples #-} import GHC.Exts newtype Eval a = Eval {runEval :: State# RealWorld -> (# State# RealWorld, a #)} -- inline sequence :: [Eval a] -> Eval [a] well_sequenced :: [Eval a] -> Eval [a] well_sequenced = foldr cons nil where cons e es = Eval $ \s -> case runEval e s of ...
urbanslug/ghc
testsuite/tests/codeGen/should_run/T10414.hs
Haskell
bsd-3-clause
1,526
module Fast2haskell ( Complex_type, Array_type, Assoc_type, Descr_type, abortstr, delay, fix, force, iff, iffrev, seQ, pair, strcmp, entier, land_i, lnot_i, lor_i, lshift_i, rshift_i, descr, destr_update, indassoc, lowbound, tabu...
ghc-android/ghc
testsuite/tests/programs/fast2haskell/Fast2haskell.hs
Haskell
bsd-3-clause
2,658
{-# LANGUAGE BangPatterns #-} module Cmm.ActivityAnalysis ( ActivityStorage(..) , activityAnalysis ) where import Cmm.DirectedGraph import Cmm.Backend (MachineInstr(..), MachineFunction(..), MachinePrg(..)) import Cmm.LabelGenerator (Temp()) import Cmm.ControlFlowGraph (createControlFlowGraph, Unique(.....
cirquit/hjc
src/Cmm/ActivityAnalysis.hs
Haskell
mit
2,790
{-# OPTIONS_GHC -Wall -fno-warn-unused-top-binds #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Okasaki.Stack ( StackF(..) , S...
jtobin/okasaki
lib/Okasaki/Stack.hs
Haskell
mit
2,028
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} ...
zenhack/haskell-capnp
lib/Capnp/Rpc/Server.hs
Haskell
mit
5,431
{- | Values implemented named terms with explicit substitutions. -} {-# LANGUAGE FlexibleContexts, FlexibleInstances, TypeSynonymInstances, MultiParamTypeClasses, OverlappingInstances, IncoherentInstances, UndecidableInstances, PatternGuards, TupleSections #-} module NamedExplSubst where import Prelude hidin...
andreasabel/helf
src/NamedExplSubst.hs
Haskell
mit
7,012
import Control.Monad import Control.Applicative solve ev od = solve' ev od where solve' :: String -> String -> String solve' [] [] = [] solve' (x:xs) [] = [x] solve' (x:xs) (y:ys) = x : y : solve' xs ys main :: IO () main = do ev <- getLine od <- getLine putStrLn $ solve ev od
pogin503/vbautil
atcoder/beg058/beg058b.hs
Haskell
mit
304
{-# LANGUAGE TypeOperators, FlexibleInstances, FlexibleContexts #-} module Data.Functor.Classes.Show.Generic ( Show1(..) , genericLiftShowsPrec , genericLiftShowList , gliftShowsPrec , gliftShowList ) where import Data.Functor.Classes import GHC.Generics import Text.Show -- | Generically-derivable lifting of the 'Sho...
tclem/lilo
src/Data/Functor/Classes/Show/Generic.hs
Haskell
mit
2,930
module SimpleArgvParser (pairArguments) where import Prelude hiding (map) import qualified Data.Map.Strict as Map strIsOption :: String -> Bool strIsOption (a:b:_) = (a == '-') && (b == '-') strIsOption _ = False -- TODO: use either here pairArguments :: [String] -> Maybe (Map.Map String String) pairArguments args =...
davidfontenot/haskell-hashtag-viewer
src/SimpleArgvParser.hs
Haskell
mit
550
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module Client where import Control.Applicative import Control.Monad import Control.Monad.Catch (MonadThrow) import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Mona...
wayofthepie/tc-rest-client
src/Client.hs
Haskell
mit
839
{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-missing-import-lists #-} {-# OPTIONS_GHC -fno-warn-implicit-prelude #-} module Paths_list_ops ( version, getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getDataFileName, getSysconfDir ) where import qualified Control.Exception as Exception imp...
c19/Exercism-Haskell
list-ops/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/autogen/Paths_list_ops.hs
Haskell
mit
2,371
module Web.YahooPortfolioManager.App ( module Web.YahooPortfolioManager.Foundation , module Web.YahooPortfolioManager.Dispatch , module Web.YahooPortfolioManager.Handlers ) where import Web.YahooPortfolioManager.Foundation import Web.YahooPortfolioManager.Dispatch () import Web.YahooPortfolioManager.Ha...
lhoghu/intranet
Web/YahooPortfolioManager/App.hs
Haskell
mit
327
-- -- If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. -- -- If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used? -- -- NOTE: Do not count spaces or hyphens. For exam...
stu-smith/project-euler-haskell
Euler-017.hs
Haskell
mit
1,563
module Properties where main :: IO () main = return ()
nickspinale/wmonad
tests/Properties.hs
Haskell
mit
56
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Kubernetes.V1.EndpointSubset where import GHC.Generics import Kubernetes.V1.EndpointAddress import Kubernetes.V1.EndpointPort import qualified ...
minhdoboi/deprecated-openshift-haskell-api
kubernetes/lib/Kubernetes/V1/EndpointSubset.hs
Haskell
apache-2.0
1,521
-- | The main Robot interface. module Test.Robot ( -- * Running your robot Robot() -- hide implementation , runRobot -- * Key and button constants , module Test.Robot.Types -- * Doing things , Pressable(press, release, hold) , moveBy , moveTo , tap -- * Mis...
lfairy/robot
Test/Robot.hs
Haskell
apache-2.0
2,461
{-# LANGUAGE OverloadedStrings, NoImplicitPrelude, FlexibleContexts #-} module Ethereum.Analyzer.EVM.CfgAugWithTopNPassSpec ( spec ) where import Protolude hiding (show) import Ckev.In.Text import Data.Text as DT import Ethereum.Analyzer.EVM import Ethereum.Analyzer.TestData.Basic import Test.Hspec spec :: Sp...
zchn/ethereum-analyzer
ethereum-analyzer/test/Ethereum/Analyzer/EVM/CfgAugWithTopNPassSpec.hs
Haskell
apache-2.0
795
{-# LANGUAGE OverloadedStrings, NamedFieldPuns #-} module FormEngine.FormElement.Rendering ( ElemAction , ElemBehaviour(..) , foldElements , renderElement ) where import Prelude import Data.Monoid ((<>)) import Data.Foldable (foldlM) import Data.Maybe (fromMaybe) import Data.Char (chr) --import Debug.Trace (traceSh...
DataStewardshipPortal/ds-form-engine
FormElement/Rendering.hs
Haskell
apache-2.0
21,774
{-# LANGUAGE NoMonomorphismRestriction #-} module Tests.OpsTest where import Ops import Lambda import Prelude ( ($), Int, (==), return, sequence, (>>=), and, (.), IO, Bool ) import qualified Control.Monad test1 :: (LOps l) => l Int test1 = app (lam $ \x -> lit 3 + x) (lit 2) test2 :: (LOps l) => l Int test2 = app (...
agobi/sizechecking
Tests/OpsTest.hs
Haskell
bsd-2-clause
1,031
module HaskHOL.Lib.IndTypes.Pre2 where import HaskHOL.Core hiding (typeOf, lefts) import HaskHOL.Core.Kernel (typeOf) import qualified HaskHOL.Core.State as S (mkType) import HaskHOL.Deductive import HaskHOL.Lib.Pair import HaskHOL.Lib.Recursion import HaskHOL.Lib.Nums import HaskHOL.Lib.CalcNum import HaskHOL.Lib.WF...
ecaustin/haskhol-math
src/HaskHOL/Lib/IndTypes/Pre2.hs
Haskell
bsd-2-clause
11,566
{-# LANGUAGE ForeignFunctionInterface #-} module Grenade.Layers.Internal.Pooling ( poolForward , poolBackward ) where import qualified Data.Vector.Storable as U ( unsafeToForeignPtr0, unsafeFromForeignPtr0 ) import Foreign ( mallocForeignPtrArray, withForeignPtr ) import Foreign.Ptr ( Ptr ...
HuwCampbell/grenade
src/Grenade/Layers/Internal/Pooling.hs
Haskell
bsd-2-clause
2,565
{-# LANGUAGE TemplateHaskell #-} module Language.Drasil.Chunk.DefinedQuantity (DefinedQuantityDict, dqd, dqdNoUnit, dqd', dqdQd, dqdWr) where import Language.Drasil.Classes.Core (HasUID(uid), HasSymbol(symbol)) import Language.Drasil.Classes (NamedIdea(term), Idea(getA), Concept, Definition(defn), ConceptDomain(cd...
JacquesCarette/literate-scientific-software
code/drasil-lang/Language/Drasil/Chunk/DefinedQuantity.hs
Haskell
bsd-2-clause
2,546
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} module Game.Types where import Data.Matrix import GHC.Generics import Data.Aeson import Data.Aeson.TH import Data.Functor data Move = Move { player :: String, outerPos :: Int, innerPos :: Int } deriving (Generic, Show, Read, Eq) data Square = X | ...
octopuscabbage/UltimateTicTacToeServer
src/Game/Types.hs
Haskell
bsd-3-clause
890
-- | Conduit of keys pressed by xinput module where
chrisdone/xinput-conduit
src/.hs
Haskell
bsd-3-clause
54
{-# OPTIONS -fno-implicit-prelude #-} ----------------------------------------------------------------------------- -- | -- Module : Foreign.C.String -- Copyright : (c) The FFI task force 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : ffi@haskell.org -- Stability ...
OS2World/DEV-UTIL-HUGS
libraries/Foreign/C/String.hs
Haskell
bsd-3-clause
4,462
{-# LANGUAGE LambdaCase, PatternGuards, ViewPatterns #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Idris.Elab.Term where import Idris.AbsSyntax import Idris.AbsSyntaxTree import Idris.DSL import Idris.Delaborate import Idris.Error import Idris.ProofSearch import Idris.Output (pshow) import Idris.Core.Case...
BartAdv/Idris-dev
src/Idris/Elab/Term.hs
Haskell
bsd-3-clause
109,952
{-# LANGUAGE DeriveDataTypeable #-} module Control.Pipe.Coroutine ( Coroutine, resume, suspend, coroutine, step, terminate ) where import Control.Monad import Control.Pipe import Control.Pipe.Exception import qualified Control.Exception as E import Data.Typeable import Prelude hiding (catch) data Corout...
pcapriotti/pipes-extra
Control/Pipe/Coroutine.hs
Haskell
bsd-3-clause
1,087
{-# LANGUAGE RankNTypes, ScopedTypeVariables, GADTs #-} {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | @operational@-style programs for 'MonadPlus'. See the -- documentation for "Control.Applicative.Operational" and -- "Control.Monad.Operational" for guidanc...
sacundim/free-operational
Control/MonadPlus/Operational.hs
Haskell
bsd-3-clause
1,859
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module RunstaskellSpec where import Control.Exception import System.Exit import System.FilePath import System.IO import System.IO.Silently import System.IO.Temp import Test.H...
soenkehahn/runstaskell
test/RunstaskellSpec.hs
Haskell
bsd-3-clause
3,049
module Day23 (part1,part2,test1,part1Solution, part2Solution) where import Control.Applicative import Data.Map.Strict (Map) import qualified Data.Map.Strict as M import Data.Sequence (Seq) import qualified Data.Sequence as S import Text.Trifecta type Registe...
z0isch/aoc2016
src/Day23.hs
Haskell
bsd-3-clause
4,599
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE PatternSynonyms #-} module Pt.StateMachine where import Ptui.Types import qualified Data.ByteString.Lazy.Char8 as B import qualified Data.ByteString.Lazy.UTF8 as U import Data.Char (isDigit) import Data.List (foldl',uncons) import Data.Mayb...
mrak/ptui
src/Pt/StateMachine.hs
Haskell
bsd-3-clause
11,621
{-# LANGUAGE OverloadedStrings #-} module ETA.CodeGen.Foreign where import ETA.Main.DynFlags import ETA.Types.Type import ETA.Types.TyCon import ETA.StgSyn.StgSyn import ETA.Prelude.ForeignCall import ETA.Utils.FastString import ETA.Utils.Util import ETA.Util import ETA.CodeGen.ArgRep import ETA.CodeGen.Env import ET...
alexander-at-github/eta
compiler/ETA/CodeGen/Foreign.hs
Haskell
bsd-3-clause
5,276
module Main where import Command main :: IO () main = execCommand
ku00/meow
app/Main.hs
Haskell
bsd-3-clause
68
module Language.Modelica.Test.Expression (test) where import qualified Language.Modelica.Parser.Expression as Expr import Language.Modelica.Test.Utility (testFunc) test :: IO [Bool] test = do res1 <- mapM (testFunc Expr.expression) $ "true <= (false * (5.0^(, , ))^(, \"bla\", 2.0))" : "3.0 : 7.0 + 8.0 ...
xie-dongping/modelicaparser
test/Language/Modelica/Test/Expression.hs
Haskell
bsd-3-clause
3,163
-- | Periodic background activities that Kademlia must perform module Network.DHT.Kademlia.Workers ( module Network.DHT.Kademlia.Workers.Interactive , module Network.DHT.Kademlia.Workers.Persistence , module Network.DHT.Kademlia.Workers.Reapers ) where import Network.DHT.Kademlia.Workers.Interactive import Network.D...
phylake/kademlia
Network/DHT/Kademlia/Workers.hs
Haskell
bsd-3-clause
396
[ ("A", [2,2]) , ("C", [0,5]) ]
dan-t/cabal-bounds
tests/inputFiles/FromFile.hs
Haskell
bsd-3-clause
32