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 Lava.Smv ( smv ) where import Lava.Signal import Lava.Netlist import Lava.Generic import Lava.Sequent import Lava.Property import Lava.Error import Lava.LavaDir import Lava.Verification import Data.List ( intersperse , nub ) import System.IO ( openFile , IOMode(..) , hPutStr , hClose ) i...
dfordivam/lava
Lava/Smv.hs
Haskell
bsd-3-clause
3,975
module Database.TokyoCabinet.Sequence where import Foreign.Ptr import Foreign.Storable (peek) import Foreign.Marshal (alloca, mallocBytes, copyBytes) import Foreign.ForeignPtr import Database.TokyoCabinet.List.C import Database.TokyoCabinet.Storable class Sequence a where withList :: (Storable s) => a s -> (Ptr...
tom-lpsd/tokyocabinet-haskell
Database/TokyoCabinet/Sequence.hs
Haskell
bsd-3-clause
2,356
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} --these two for Isomorphic class {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} -- necessary for Shapely Generics instances {-# LANGUAGE TypeOperators #-} -- for our cons synonym {-# LANGUA...
jberryman/shapely-data
src/Data/Shapely/Classes.hs
Haskell
bsd-3-clause
3,973
{-# LANGUAGE OverloadedStrings #-} module Database.MetaStorage.Spec (metaStorageSpec) where import Test.Hspec import Test.QuickCheck import Filesystem.Path.CurrentOS import Crypto.Hash import Filesystem import Database.MetaStorage import Database.MetaStorage.Types metaStorageSpec :: Spec metaStorageSpec = do desc...
alios/metastorage
Database/MetaStorage/Spec.hs
Haskell
bsd-3-clause
1,588
module Network.Tangaroa.Byzantine.Server ( runRaftServer ) where import Data.Binary import Control.Concurrent.Chan.Unagi import Control.Lens import qualified Data.Set as Set import Network.Tangaroa.Byzantine.Handler import Network.Tangaroa.Byzantine.Types import Network.Tangaroa.Byzantine.Util import Network.Tang...
chrisnc/tangaroa
src/Network/Tangaroa/Byzantine/Server.hs
Haskell
bsd-3-clause
808
{-# LANGUAGE ApplicativeDo #-} {-# LANGUAGE EmptyCase #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANG...
mstksg/tensor-ops
src/TensorOps/Backend/BTensor.hs
Haskell
bsd-3-clause
30,700
-- | this module contains the defs of common data types and type classes module Text.Regex.Deriv.Common ( Range(..), range, minRange, maxRange , Letter , PosEpsilon (..) , IsEpsilon (..) , IsPhi (..) , Simplifiable (..) , myHash , myLookup , GFlag (..) , IsGreedy (..) , nub2...
awalterschulze/xhaskell-regex-deriv
Text/Regex/Deriv/Common.hs
Haskell
bsd-3-clause
3,221
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module State6502 where import Data.Word import Deque import Data.Array import Data.Time.Clock import Control.Lens import Control.Monad.State import Data.Bits.Lens import System.Console.Haskeline import Data.Array.IO import qualified Data.Int...
dpiponi/Bine
src/State6502.hs
Haskell
bsd-3-clause
1,646
{-# LANGUAGE DeriveDataTypeable #-} {-# 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 #-} ------------------------------------------------------...
csabahruska/GFXDemo
Thrift/ContentProvider_Client.hs
Haskell
bsd-3-clause
1,913
{-# Language ScopedTypeVariables #-} {-# Language DeriveGeneric #-} {-# Language DeriveDataTypeable #-} module StateManager where import Control.Distributed.Process import Control.Monad (filterM) import Control.Monad.Trans.State.Strict import Control.Monad.Trans.Class (lift) import Data.Binary (Binary) import Data.Ma...
sgeop/side-batch
src/StateManager.hs
Haskell
bsd-3-clause
1,333
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Cardano.Wa...
input-output-hk/pos-haskell-prototype
wallet/src/Cardano/Wallet/API/Indices.hs
Haskell
mit
6,558
----------------------------------------------------------------------------- -- | -- Module : Control.Monad.Indexed.Fix -- Copyright : (C) 2008 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : experimental -- Portability : ...
urska19/MFP---Samodejno-racunanje-dvosmernih-preslikav
Control/Monad/Indexed/Fix.hs
Haskell
apache-2.0
575
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "src/Data/Foldable/Compat.hs" #-} {-# LANGUAGE CPP, NoImplicitPrelude #-} module Data.Foldable.Compat ( module Base , maximumBy , minimumBy ) where import Data.Foldable as Base hiding (maximumBy, minimumBy) import Prelude (Orderin...
phischu/fragnix
tests/packages/scotty/Data.Foldable.Compat.hs
Haskell
bsd-3-clause
902
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[PrimOp]{Primitive operations (machine-level)} -} {-# LANGUAGE CPP #-} module PrimOp ( PrimOp(..), PrimOpVecCat(..), allThePrimOps, primOpType, primOpSig, primOpTag, maxPrimOpTag, primOpOcc, tagToEnumKey, p...
siddhanathan/ghc
compiler/prelude/PrimOp.hs
Haskell
bsd-3-clause
23,245
module Test20 where y c = c f n y = n y g = (f 1 1) h = (+1) 1
kmate/HaRe
old/testing/refacFunDef/Test20.hs
Haskell
bsd-3-clause
67
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 @Uniques@ are used to distinguish entities in the compiler (@Ids@, @Classes@, etc.) from each other. Thus, @Uniques@ are the basic comparison key in the compiler. If there is any single operation that needs to be fast, i...
acowley/ghc
compiler/basicTypes/Unique.hs
Haskell
bsd-3-clause
11,873
{-# LANGUAGE OverloadedLabels, DataKinds, FlexibleContexts #-} import GHC.OverloadedLabels -- No instance for (OverloadedLabel "x" t0) a = #x -- No instance for (OverloadedLabel "x" (t0 -> t1), OverloadedLabel "y" t0) b = #x #y -- Could not deduce (OverloadedLabel "y" t) from (OverloadedLabel "x" t) c :: IsLabel "x...
olsner/ghc
testsuite/tests/overloadedrecflds/should_fail/overloadedlabelsfail01.hs
Haskell
bsd-3-clause
354
{-# OPTIONS_HADDOCK hide #-} module Ticket61_Hidden where class C a where -- | A comment about f f :: a
DavidAlphaFox/ghc
utils/haddock/html-test/src/Ticket61_Hidden.hs
Haskell
bsd-3-clause
110
{-# LANGUAGE DuplicateRecordFields #-} module OverloadedRecFldsRun02_A (U(..), V(MkV, x), Unused(..), u) where data U = MkU { x :: Bool, y :: Bool } data V = MkV { x :: Int } data Unused = MkUnused { unused :: Bool } u = MkU False True
shlevy/ghc
testsuite/tests/overloadedrecflds/should_run/OverloadedRecFldsRun02_A.hs
Haskell
bsd-3-clause
239
{-# htermination min :: Char -> Char -> Char #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_min_3.hs
Haskell
mit
49
{-# LANGUAGE TupleSections #-} -- | Parser for .prof files generated by GHC. module ProfFile ( Time(..) , Line(..) , lIndividualTime , lInheritedTime , lIndividualAlloc , lInheritedAlloc , parse , processLines , findStart ) where import Control.Arrow (second, left) import Data.C...
fpco/ghc-prof-flamegraph
ProfFile.hs
Haskell
mit
6,019
module Monoid8 where import Data.Monoid import Test.QuickCheck import SemiGroupAssociativeLaw import Test.HUnit import MonoidLaws import Text.Show.Functions import ArbitrarySum newtype Mem s a = Mem { runMem :: s -> (a,s) } deriving Show mappendMem :: Monoid a => Mem s a -> Mem s a -> Mem s a mappendMem f1 f2 = ...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter15.hsproj/Monoid8.hs
Haskell
mit
2,666
-- 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/Binding.hs
Haskell
mit
2,009
-------------------------------------------------------------------- -- | -- Copyright : © Oleg Grenrus 2014 -- License : MIT -- Maintainer: Oleg Grenrus <oleg.grenrus@iki.fi> -- Stability : experimental -- Portability: non-portable -- -- This module re-exports tree-based implementation. -------------------------...
phadej/boolean-normal-forms
src/Data/Algebra/Boolean/NNF.hs
Haskell
mit
484
{-# language NoImplicitPrelude, DoAndIfThenElse, OverloadedStrings, ExtendedDefaultRules #-} module IHaskell.Publish (publishResult) where import IHaskellPrelude import qualified Data.Text as T import qualified Data.Text.Encoding as E import IHaskell.Display import IHaskell.Types import...
sumitsahrawat/IHaskell
src/IHaskell/Publish.hs
Haskell
mit
3,310
module Interpreter where -- union = union (|||), delete = remove (---) import Parsing import Data.List -- Free variables of a term (variables that are not bound by a lambda) freeVariables :: Term -> [Var] freeVariables (Constant _) = [] freeVariables (Variable v) = [v] freeVariables (Application (a, b)) = (freeVari...
JorisM/HLambdaCalculus
Interpreter.hs
Haskell
mit
2,187
-- ch4.hs module Ch4 where isPalindrome :: (Eq a) => [a] -> Bool isPalindrome xs = (reverse xs) == xs myAbs :: Integer -> Integer myAbs x = if x >= 0 then x else (-x) f :: (a, b) -> (c, d) -> ((b, d), (a, c)) f x y = ((snd x, snd y), (fst x, fst y))
candu/haskellbook
ch4/ch4.hs
Haskell
mit
252
module Language.Asol.Expression where data Instruction = Push Integer | Top Int | Pop | Print | Read | Emit | Mul | Sub | Add | Div | Mod ...
kmein/asol
Language/Asol/Expression.hs
Haskell
mit
468
-- Core stuff: Tic Tac Toe struct, win conditions module Core where data Place = X | O | E deriving (Show, Eq) -- X, O or Empty data Player = PX | PO | N deriving (Show, Eq) -- N is to be used only for a full board where no one has won getPlace :: Player -> Place getPlace player = case player of PX -> X ...
quantum-dan/tictactoe-ai
Core.hs
Haskell
mit
3,579
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ViewPatterns #-} module Commands.TH.Data where import Commands.Grammar import Data.List.NonEmpty (toList) import Data.Functor import Language.Haskell.TH import Language.Haskell.TH.Syntax -- | -- given the input 'Production': -- -- > Production ''Command [ -- > Varian...
sboosali/Haskell-DragonNaturallySpeaking
sources/Commands/TH/Data.hs
Haskell
mit
1,628
{------------------------------------------------------------------------------- Consider the consecutive primes p₁ = 19 and p₂ = 23. It can be verified that 1219 is the smallest number such that the last digits are formed by p₁ whilst also being divisible by p₂. In fact, with the exception of p₁ = 3 and p₂ = 5, for ...
dpieroux/euler
0134.hs
Haskell
mit
1,797
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveDataTypeable #-} module WS.App where import Control.Applicative ((<$>), (<*>)) import Control.Exception (Exception) import Control.Monad.Catch (MonadThrow, MonadCatch, throwM...
krdlab/haskell-webapp-testing-experimentation
src/WS/App.hs
Haskell
mit
4,212
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleInstances #-} class TooMany a where tooMany :: a -> Bool instance TooMany Int where tooMany n = n > 42 {- newtype Goats = Goats Int deriving Show -} -- with GeneralizedNewtypeDeriving, we can get this automatically: newtype Goats = Goats Int ...
JustinUnger/haskell-book
ch11/learn.hs
Haskell
mit
1,105
{-# LANGUAGE BangPatterns, CPP, FlexibleContexts #-} -- | -- Module : Statistics.Correlation.Kendall -- -- Fast O(NlogN) implementation of -- <http://en.wikipedia.org/wiki/Kendall_tau_rank_correlation_coefficient Kendall's tau>. -- -- This module implementes Kendall's tau form b which allows ties in the data. -- T...
kaizhang/statistics-correlation
Statistics/Correlation/Kendall.hs
Haskell
mit
5,569
module Hoton.Types ( Number ) where type Number = Double
woufrous/hoton
src/Hoton/Types.hs
Haskell
mit
63
-- | -- Module: Math.NumberTheory.Zeta.Hurwitz -- Copyright: (c) 2018 Alexandre Rodrigues Baldé -- Licence: MIT -- Maintainer: Alexandre Rodrigues Baldé <alexandrer_b@outlook.com> -- -- Hurwitz zeta function. {-# LANGUAGE ScopedTypeVariables #-} module Math.NumberTheory.Zeta.Hurwitz ( zetaHurwitz ) wh...
Bodigrim/arithmoi
Math/NumberTheory/Zeta/Hurwitz.hs
Haskell
mit
4,891
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE PartialTypeSignatures #-} module Web.Views.Index where import Model.CoreTypes import Web.Utils import Web.Routes as R import Web.Views.DiamondButton import Text.Blaze.Html5 ((!)) import qualified Text.Blaze.Html5 as H import qualified Text.Bl...
tomleb/portfolio
src/Web/Views/Index.hs
Haskell
mit
1,036
module Main where import qualified Data.ByteString.Lazy.Char8 as BS import Data.Maybe (fromJust) import Data.Aeson (decode) import LevelParser import ParitySolver main :: IO () main = do fc <- BS.readFile "story.json" let levels = map f...
jcla1/parity-solver
Main.hs
Haskell
mit
498
isPrime::Integer->Bool isPrime n = null [x | x <- [2..(floor(sqrt(fromInteger n)))], mod n x == 0] factors::Integer->[Integer] factors n = [x | x <- [1..n], mod n x == 0] main::IO() main = print $ last $ takeWhile isPrime $ factors 600851475143
neutronest/eulerproject-douby
e3/e3.hs
Haskell
mit
247
diffHam :: (Integral a) => a -> a -> a diffHam a b | a == 0 && b == 0 = 0 | otherwise = let rr = if (mod a 2) /= (mod b 2) then 1 else 0 in rr + diffHam (div a 2) (div b 2) totalHammingDistance :: (Integral a) => [a] -> a totalHammingDistance [] = 0 t...
ccqpein/Arithmetic-Exercises
Total-Hamming-Distance/THD.hs
Haskell
apache-2.0
402
import Text.CSV import Data.List as L import Text.Nagato.NagatoIO as NagatoIO import Text.Nagato.Models as Models import Text.Nagato.MeCabTools as MeCabTools import qualified Text.Nagato.Classify as NC import qualified Text.Nagato.Train as Train import qualified Text.Nagato.Train_complement as Train_compl main = do ...
haru2036/nagato
samples/tester.hs
Haskell
apache-2.0
3,593
import Data.Set (Set) import qualified Data.Set as Set -- See TorusLatticeWalk.hs, this is mostly copied and pasted from there with -- some changes to nextStatesRight and nextStatesUp -- Notes: I can prove that the number of all cylinder walks is w^h where w is -- the width, and h is the right. (At each height, take 0...
peterokagey/haskellOEIS
src/Sandbox/CylinderLatticeWalk.hs
Haskell
apache-2.0
3,524
module Arbitrary.File where import Test.QuickCheck --import qualified Data.Test as T import Filesystem.Path.CurrentOS import Prelude hiding (FilePath, writeFile) import qualified Data.Set as S import Control.Applicative import Data.ModulePath import Control.Lens import Arbitrary.TestModule (toGenerated, testModulePath...
jfeltz/tasty-integrate
tests/Arbitrary/File.hs
Haskell
bsd-2-clause
2,787
module Ovid.Prelude ( JsCFAState (..) , CFAOpts (..) , emptyCFAOpts , message , warnAt , enableUnlimitedRecursion, enablePreciseArithmetic, enablePreciseConditionals -- source positions , SourcePos, sourceName -- Monads , module Control.Monad , module Control.Monad.Trans , module Control.Monad....
brownplt/ovid
src/Ovid/Prelude.hs
Haskell
bsd-2-clause
4,321
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QTreeWidget_h.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:27 Warning : this file is machine generated - do...
keera-studios/hsQt
Qtc/Gui/QTreeWidget_h.hs
Haskell
bsd-2-clause
132,988
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Lens import Data.Bool (bool) import Data.Maybe (fromMaybe) import Data.Text (Text) import Network.URI (URI) import Hackerspace.Space import qualified Network.Browser as Browser import qualified Network.HTTP as HTTP import qualified Network.URI ...
HackerspaceBielefeld/hackerspaceapi-haskell
src/Main.hs
Haskell
bsd-2-clause
1,121
{- OPTIONS_GHC -fplugin Brisk.Plugin #-} {- OPTIONS_GHC -fplugin-opt Brisk.Plugin:main #-} {-# LANGUAGE TemplateHaskell #-} module SpawnSym where import Control.Monad (forM, foldM) import Control.Distributed.Process import Control.Distributed.BriskStatic import Control.Distributed.Process.Closure import Control.Distri...
abakst/brisk-prelude
tests/pos/SpawnSymForM.hs
Haskell
bsd-3-clause
1,036
{-# language CPP #-} -- | = Name -- -- VK_EXT_physical_device_drm - device extension -- -- == VK_EXT_physical_device_drm -- -- [__Name String__] -- @VK_EXT_physical_device_drm@ -- -- [__Extension Type__] -- Device extension -- -- [__Registered Extension Number__] -- 354 -- -- [__Revision__] -- 1 -- -- [...
expipiplus1/vulkan
src/Vulkan/Extensions/VK_EXT_physical_device_drm.hs
Haskell
bsd-3-clause
9,168
module Sexy.Instances.Show.Double () where import Sexy.Classes (Show(..)) import Sexy.Data (Double) import qualified Prelude as P instance Show Double where show = P.show
DanBurton/sexy
src/Sexy/Instances/Show/Double.hs
Haskell
bsd-3-clause
176
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeInType #-} {-# LANGUAGE TypeFamilyDependencies #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE ExplicitForAll #-} {-# LANGUAGE Inst...
sleexyz/haskell-fun
Singletons.hs
Haskell
bsd-3-clause
2,511
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} -- -- A Mandelbrot set generator. -- Originally submitted by Simon Marlow as part of Issue #49. -- module Mandel ( -- Types View, Render, Bitmap, -- Pretty pictures mandelbrot, prettyRGBA, ) where import Prelude ...
vollmerm/shallow-fission
tests/mandelbrot/src-acc/Mandel.hs
Haskell
bsd-3-clause
5,237
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ViewPatterns #-} module Physics.Bullet.PointToPointConstrain...
lukexi/bullet-mini
src/Physics/Bullet/PointToPointConstraint.hs
Haskell
bsd-3-clause
2,693
module CC.Language where import Data.List (transpose) import Data.Map (Map) import qualified Data.Map as Map import Data.Set (Set) import qualified Data.Set as Set -- -- * Syntax -- -- | Minimal, generic, binary choice calculus syntax. data CC t e = Obj (e (CC t e)) | Chc t (CC t e) (CC t e) class Obj e w...
walkie/CC-Minimal
src/CC/Language.hs
Haskell
bsd-3-clause
2,559
module Language.Interpreter.StdLib.BlockHandling ( addBlockHandlingStdLib ) where import Language.Ast ( Value(Null) ) import Language.Interpreter.Types ( InterpreterProcess , setBuiltIn ...
rumblesan/proviz
src/Language/Interpreter/StdLib/BlockHandling.hs
Haskell
bsd-3-clause
923
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} module Prosper.Commands ( invest , account , allListings , notes , listingFromNote , listingCSV , AccountException (..) , UnauthorizedException (..) ) where import Control.Exception (Exception, ...
WraithM/prosper
src/Prosper/Commands.hs
Haskell
bsd-3-clause
2,860
module Lint where import Control.Monad.Writer import Data.List (intercalate) import Statement import Expression (Name, Expr(..)) -- Quick 'n dirty! Unused variables are any variable that's in an assignment -- statement, but not in any expression. As a proof-of-concept, we do directly -- this, and first make a pass ove...
shawa/delorean
src/Lint.hs
Haskell
bsd-3-clause
1,872
{-# LANGUAGE CPP #-} module MacAddress where import Data.Binary (decode) import qualified Data.ByteString.Lazy as BSL import Safe (headDef) #ifdef ETA_VERSION import Java import Data.Maybe (catMaybes) import Data.Traversable (for) import Data.Word (Word64...
cblp/crdt
crdt/lib/MacAddress.hs
Haskell
bsd-3-clause
1,697
import System.Environment (getArgs) import Data.List (sort) bat :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> [Int] -> Int bat l d n c s t tx xs | s > l - 6 = c | s > tx - d && t == n = bat l d n c (tx+d) t (l-6+d) xs | s > tx - d ...
nikai3d/ce-challenges
moderate/bats.hs
Haskell
bsd-3-clause
680
{- - 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 GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} module Data.MexSet (MexSet, ...
ti1024/hacq
src/Data/MexSet.hs
Haskell
bsd-3-clause
3,215
{-| Directory tree database. Directory database of B+ tree: huge DBM with order. * Persistence: /persistent/ * Algorithm: /B+ tree/ * Complexity: /O(log n)/ * Sequence: /custom order/ * Lock unit: /page (rwlock)/ -} module Database.KyotoCabinet.DB.Forest ( Forest , ForestOptions (..) , defaul...
bitonic/kyotocabinet
Database/KyotoCabinet/DB/Forest.hs
Haskell
bsd-3-clause
3,570
{-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module CANOpen.Tower.NMT where import Ivory.Language import Ivory.Stdlib import Ivory.Tower import Ivory.Tower.HAL.Bus.CAN import Ivory.Tower.HAL.Bus.Interface import Ivory.Tower.HAL.Bus.CAN.Fragment import Ivory.Ser...
distrap/ivory-tower-canopen
src/CANOpen/Tower/NMT.hs
Haskell
bsd-3-clause
5,043
{-# LANGUAGE FlexibleContexts #-} module Advent.Day6 where import qualified Data.Text as T import Text.Parsec as Parsec (many1 , char , newline , sepEndBy , try , string ...
screamish/adventofhaskellcode
src/Advent/Day6.hs
Haskell
bsd-3-clause
3,203
module LetLang.ParserSuite ( tests ) where import LetLang.Data import LetLang.Parser import Test.HUnit.Base import Text.Megaparsec import Text.Megaparsec.String tests :: Test tests = TestList [ TestLabel "Test const expression" testConstExpr , TestLabel "Test bina...
li-zhirui/EoplLangs
test/LetLang/ParserSuite.hs
Haskell
bsd-3-clause
5,455
module Wikirick.JSONConnection where import Control.Exception hiding (Handler) import Data.Aeson import Data.Typeable import Snap data JSONParseError = JSONParseError String deriving (Eq, Show, Typeable) instance Exception JSONParseError data JSONConnection = JSONConnection { _parseJSON :: (MonadSnap m, FromJSON a...
keitax/wikirick
src/Wikirick/JSONConnection.hs
Haskell
bsd-3-clause
638
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE RecordWildCards #-} module Juno.Consensus.Handle.AppendEntriesResponse (handle ,handleAlotOfAers ,updateCommitProofMap) where import Control.Lens hiding (Index) import C...
haroldcarr/juno
src/Juno/Consensus/Handle/AppendEntriesResponse.hs
Haskell
bsd-3-clause
6,373
-- | The Finite Module which exports Finite ---------------------------------------------------------------- module Finite (Finite(..), (*^), (*^-), sigfigs, orderOfMagnitude, showNatural, showFull, showScientific, roundToPrecision, fromIntegerWithPrecision, fromIntegerMatchingPrecision) where -----------------------...
Conflagrationator/HMath
src/Finite.hs
Haskell
bsd-3-clause
6,948
-- for TokParsing, MonadicParsing {-# LANGUAGE ConstraintKinds #-} -- for impOrExpVar {-# LANGUAGE TupleSections #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} -- ghc opts / calm down ghc-mod -- {-# OPTIONS_GHC -Wall #-} -- {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- {-# OPT...
reuleaux/pire
src/Pire/Parser/Nat.hs
Haskell
bsd-3-clause
2,865
module Main where --gcd :: Int -> Int -> Int --gcd x 0 = x --gcd x y -- | x < y = gcd y x -- | otherwise = gcd y (mod x y) --lcm :: Int -> Int -> Int --lcm x y = let g = gcd (x y) -- in (div x g) * (div y g) * g splitBy delimiter = foldr f [[]] where f c l@(x:xs) | c == delimiter = []:l ...
everyevery/programming_study
hackerrank/functional/jumping-bunnies/jumping-bunnies.hs
Haskell
mit
548
{-# LANGUAGE OverloadedStrings, ExistentialQuantification, ExtendedDefaultRules, FlexibleContexts, TemplateHaskell #-} module Dashdo.Examples.GapminderScatterplot where import Numeric.Datasets import Numeric.Datasets.Gapminder import Dashdo import Dashdo.Types import Dashdo.Serve import Dashdo.Elements import Lucid i...
diffusionkinetics/open
dashdo-examples/lib/Dashdo/Examples/GapminderScatterplot.hs
Haskell
mit
5,579
{-# LANGUAGE PatternSynonyms #-} module Foo(A(.., B)) where data A = A | B
mpickering/ghc-exactprint
tests/examples/ghc8/export-syntax.hs
Haskell
bsd-3-clause
76
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Plots.CmdLine where -- ( module Plots -- , r2AxisMain -- ) where -- import Data.Typeable -- import Options.Appl...
bergey/plots
src/Plots/CmdLine.hs
Haskell
bsd-3-clause
1,379
f [] a = return a ; f (x:xs) a = a + x >>= \fax -> f xs fax
mpickering/hlint-refactor
tests/examples/ListRec4.hs
Haskell
bsd-3-clause
59
{-# LANGUAGE TypeFamilies, NoMonomorphismRestriction #-} module T2767a where import Data.Kind (Type) main = return () -- eval' :: Solver solver => Tree solver a -> [(Label solver,Tree solver a)] -> solver [a] eval' (NewVar f) wl = do v <- newvarSM eval' (f v) wl eval' Fail wl = contin...
sdiehl/ghc
testsuite/tests/indexed-types/should_compile/T2767.hs
Haskell
bsd-3-clause
791
<?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>Getting started Guide</title> <maps> <homeID>top</homeID> <mapref loca...
ccgreen13/zap-extensions
src/org/zaproxy/zap/extension/gettingStarted/resources/help_fil_PH/helpset_fil_PH.hs
Haskell
apache-2.0
968
{-# LANGUAGE TypeFamilies, QuasiQuotes, TemplateHaskell, MultiParamTypeClasses, OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ViewPatterns #-} module YesodCoreTest.ErrorHandling ( errorHandlingTest , Widget ) where import Yesod.Core import Test.Hspec import Network.Wai import Netwo...
pikajude/yesod
yesod-core/test/YesodCoreTest/ErrorHandling.hs
Haskell
mit
7,179
{-# LANGUAGE MagicHash, UnliftedFFITypes #-} -- !!! cc004 -- foreign declarations module ShouldCompile where import Foreign import GHC.Exts import Data.Int import Data.Word -- importing functions -- We can't import the same function using both stdcall and ccall -- calling conventions in the same file when compiling ...
hferreiro/replay
testsuite/tests/ffi/should_compile/cc004.hs
Haskell
bsd-3-clause
1,861
{-# LANGUAGE RoleAnnotations #-} {-# OPTIONS_GHC -fwarn-unused-imports #-} import Data.Coerce import Data.Proxy import Data.Monoid (First(First)) -- check whether the implicit use of First is noted -- see https://ghc.haskell.org/trac/ghc/wiki/Design/NewCoercibleSolver/V2 foo1 :: f a -> f a foo1 = coerce newtype X ...
urbanslug/ghc
testsuite/tests/typecheck/should_compile/TcCoercibleCompile.hs
Haskell
bsd-3-clause
896
-- !!! Importing Tycon with bogus constructor module M where import Prelude(Either(Left,Right,Foo))
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/module/mod81.hs
Haskell
bsd-3-clause
101
main :: IO () main = do putStrLn "Escriba un nombre: " nombre <- getLine case nombre of "Napoleon" -> putStrLn "Su apellido es Bonaparte!" _ -> putStrLn "No se ha podido determinar su apellido"
clinoge/primer-semestre-udone
src/04-condicionales/nombre.hs
Haskell
mit
231
module Bio.Utils.Misc ( readInt , readDouble , bins , binBySize , binBySizeLeft , binBySizeOverlap ) where import Data.ByteString.Char8 (ByteString) import Data.ByteString.Lex.Fractional (readExponential, readSigned) import Data.ByteString.Lex.Integral...
kaizhang/bioinformatics-toolkit
bioinformatics-toolkit/src/Bio/Utils/Misc.hs
Haskell
mit
2,028
module Bot ( Event (..) , Response (..) , handleEvent ) where import Data.List import Data.List.Split import Data.Char (toLower) import Network.HTTP.Base (urlEncode) data Event = Msg { msg :: String , sender :: String } data Response = SendMsg { msgToSend :: String } -- ...
TheCrafter/Scarybot
src/Bot.hs
Haskell
mit
2,215
{-# LANGUAGE TupleSections #-} module System where import System.Directory import System.FilePath import Aws import Control.Monad import Data.Text (Text) -- | Loads the aws creds by keyname from the currenty directory or parent -- directories. loadAwsCreds :: Text -> IO (Maybe (FilePath, Credentials)) loadAwsCreds ke...
schell/dropdox
src/System.hs
Haskell
mit
1,193
{-# LANGUAGE OverloadedStrings #-} import Control.Applicative ((<$>)) import Data.List (intercalate,sortBy) import Text.Blaze.Html (toHtml,toValue, (!)) import Text.Blaze.Html.Renderer.String (renderHtml) import qualified Text.Blaze.Html5 as BlazeHtml import qualified Text.Blaze.Html5.Attributes as BlazeAttr import Dat...
WarwickMasson/wmasson-hakyll
site.hs
Haskell
mit
6,246
{-# LANGUAGE GADTs #-} module Kafkaesque.Request.Offsets ( offsetsRequestV0 , respondToRequestV0 ) where import Data.Attoparsec.ByteString (Parser) import Data.Int (Int32, Int64) import Data.Maybe (catMaybes, fromMaybe) import qualified Data.Pool as Pool import qualified Database.PostgreSQL.Simple as PG import...
cjlarose/kafkaesque
src/Kafkaesque/Request/Offsets.hs
Haskell
mit
3,819
import System.Environment import System.IO import Data.List import Data.Ord import qualified Data.Map as M import System.Process splitOn :: (a -> Bool) -> [a] -> [[a]] splitOn f [] = [[]] splitOn f (h:t) = let (rh:rt) = splitOn f t ret = (h:rh):rt in if f h then []:ret else ret ...
mjrosenb/bend
bend.hs
Haskell
mit
1,680
{-# LANGUAGE OverloadedStrings #-} module Text.Marquee.Parser.Block (parseBlocks) where import Control.Applicative import Control.Monad import Control.Monad.State (StateT(..), get, modify, lift) import Data.Char (isLetter, isUpper) import Data.Text (Text()) import qualified Data.Text as T import Data.Attoparsec.Tex...
DanielRS/marquee
src/Text/Marquee/Parser/Block.hs
Haskell
mit
5,830
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.RTCDTMFSender (js_insertDTMF, insertDTMF, js_getCanInsertDTMF, getCanInsertDTMF, js_getTrack, getTrack, js_getToneBuffer, getToneBuffer, js_getDuration, getDuration, js_getInterToneGap, getI...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/RTCDTMFSender.hs
Haskell
mit
3,788
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Main where import Control.Applicative import Control.Monad import Control.Concurrent.STM import Data.Hashable import Data.Function (on) import qualified Data.Map as M import qualified Data.List as L import qualified Control.Concurrent.STM.Map as TTrie import Test.Qui...
mcschroeder/ttrie
tests/MapProperties.hs
Haskell
mit
3,168
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} import System.Environment import Data.Text import Control.Monad import qualified Data.ByteString as BS (writeFile, readFile) import qualified Codec.Compression.Zlib as ZL import qualified Data.Text.Encoding as TE import Data.Serialize as DS -- newtype NewText = ...
BitFunctor/bitfunctor-theory
aux/testsertext.hs
Haskell
mit
1,080
module Graphics.Urho3D.Graphics.Internal.Texture( Texture , SharedTexture , WeakTexture , textureCntx , sharedTexturePtrCntx , weakTexturePtrCntx ) where import Graphics.Urho3D.Container.Ptr import qualified Language.C.Inline as C import qualified Language.C.Inline.Context as C import qualified Languag...
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Graphics/Internal/Texture.hs
Haskell
mit
577
module Mood where data Mood = Blah | Woot deriving Show changeMood :: Mood -> Mood changeMood Blah = Woot changeMood _ = Blah
mikegehard/haskellBookExercises
chapter4/mood.hs
Haskell
mit
136
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Monad (msum) import Happstack.Server import Web.Routes.Happstack (implSite) import BBQ.Route import Data.Accounts import Data.RecordPool import Data.Sheets import Data.AppConfig withAcid path action = openAccountsState path $ \st1 -...
yan-ac/bbq.yan.ac
bbq.hs
Haskell
mit
908
{-# htermination zipWithM :: (a -> b -> Maybe c) -> [a] -> [b] -> Maybe [c] #-} import Monad
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Monad_zipWithM_3.hs
Haskell
mit
93
module Language.Lips.Evaluator where -------------------- -- Global Imports -- import Control.Monad.State (liftIO) import Control.Monad ------------------- -- Local Imports -- import Language.Lips.LanguageDef import Language.Lips.State ---------- -- Code -- -- Lifting an error liftError :: Error LipsVal -> LipsVal ...
crockeo/lips
src/lib/Language/Lips/Evaluator.hs
Haskell
mit
3,307
-- {{{ {-# LANGUAGE OverloadedStrings, MultiWayIf, LambdaCase #-} module Main where ---------------------Import------------------------- import Prelude import Data.List import Data.Char import qualified Data.ByteString.Char8 as BS -- BS.getContents import qualified Data.Vector as V import qualified Data.Map as Map impo...
abhiranjankumar00/dot-vim
skel/skel.hs
Haskell
mit
1,115
-- :l C:\Local\Dev\haskell\h4c.hs -- Exemplos do tutorial http://www.haskell.org/haskellwiki/Haskell_Tutorial_for_C_Programmers -- 2.5 -- Uma implementação recursiva de fib que usa uma função auxiliar geradora fib :: Integer -> Integer fib n = fibGen 0 1 n fibGen :: Integer -> Integer -> Integer -> Integer fibGen ...
feliposz/learning-stuff
haskell/h4c.hs
Haskell
mit
4,833
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TemplateHaskell #-} module Main where import Data.Foldable (traverse_) import Data.Text (Text) import Data.Default import Data.Memory.Types...
shockkolate/brainfart
examples/basic/Main.hs
Haskell
apache-2.0
2,914
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE TypeOperators #-} module Camfort.Specification.StencilsSpec (spec) where import Control.Monad.Writer.Strict hiding (Sum...
mrd/camfort
tests/Camfort/Specification/StencilsSpec.hs
Haskell
apache-2.0
18,775
module CustomList where data List a = Nil | Cons a (List a) deriving Show emptyList :: List a emptyList = Nil isEmpty :: List a -> Bool isEmpty Nil = True isEmpty (Cons _ _) = False cons :: a -> List a -> List a cons = Cons head :: List a -> a head Nil = error "Empty list" head (Cons x _) = x ...
wildsebastian/PurelyFunctionalDataStructures
chapter02/CustomList.hs
Haskell
apache-2.0
1,052
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module NLP.MorfNCP ( temp ) where import Control.Monad (forM_) -- import qualified Data.Text.Lazy as L import qualified Data.Text.Lazy.IO as L import qualified Data.Tagset.Positional as P import qualified NLP.MorfNCP.Base as Base import...
kawu/morf-nkjp
src/NLP/MorfNCP.hs
Haskell
bsd-2-clause
2,509