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 MultiParamTypeClasses #-}
-- |
-- Module : Simulation.Aivika.Experiment.Chart.DeviationChartView
-- Copyright : Copyright (c) 2012-2017, David Sorokin <david.sorokin@gmail.com>
-- License : BSD3
-- Maintainer : David Sorokin <david.sorokin@gmail.com>
-- Stability : experimental
-- Tested with: G... | dsorokin/aivika-experiment-chart | Simulation/Aivika/Experiment/Chart/DeviationChartView.hs | Haskell | bsd-3-clause | 17,560 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 800
{-# OPTIONS_GHC -fno-warn... | cdornan/idiot | Text/RE/TDFA/Text/Lazy.hs | Haskell | bsd-3-clause | 2,471 |
module Arhelk.Russian.Lemma.Data.Substantive where
import Arhelk.Russian.Lemma.Data.Common
import Lens.Simple
import Data.Monoid
import TextShow
-- | Склонение. Describes declension of substantives
data Declension =
FirstDeclension
| SecondDeclension
| ThirdDeclension
deriving (Eq, Ord, Enum, Show, Bound... | Teaspot-Studio/arhelk-russian | src/Arhelk/Russian/Lemma/Data/Substantive.hs | Haskell | bsd-3-clause | 3,365 |
-- The Timber compiler <timber-lang.org>
--
-- Copyright 2008-2009 Johan Nordlander <nordland@csee.ltu.se>
-- 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 sour... | mattias-lundell/timber-llvm | src/Lambdalift.hs | Haskell | bsd-3-clause | 11,061 |
{-|
Copyright : (c) Dave Laing, 2017
License : BSD3
Maintainer : dave.laing.80@gmail.com
Stability : experimental
Portability : non-portable
-}
{-# LANGUAGE ConstraintKinds #-}
module Fragment.Annotation.Rules.Type.Infer.SyntaxDirected (
AnnotationInferTypeContext
, annotationInferTypeRules
) where
im... | dalaing/type-systems | src/Fragment/Annotation/Rules/Type/Infer/SyntaxDirected.hs | Haskell | bsd-3-clause | 777 |
{-# LANGUAGE OverloadedStrings #-}
-- | Find paths given the root directory of deployment.
module Paths
( RootDir
, incoming
, angelConf
, nginxConf
, postgresConf
) where
import Prelude ()
import Filesystem.Path.CurrentOS (FilePath, (</>))
type RootDir = FilePath
incoming :: RootDir -> FileP... | yesodweb/deploy | src/Paths.hs | Haskell | bsd-3-clause | 595 |
{-# language TemplateHaskell, GADTs #-}
import Data.Function.Memoize
import Control.Monad (forM_, when)
import Test3Helper
-- NonstandardParams is defined by:
--
-- data NonstandardParams a b
-- = NonstandardParams (a -> Bool) b
--
-- This won’t compile because it needs addition typeclass constraints in
-- the ... | tov/memoize | test/test3.hs | Haskell | bsd-3-clause | 1,093 |
{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS_GHC -Wall #-}
{-# OPTIONS_GHC -fno-warn-missing-methods #-}
module HW06.HW06 where
-- Exercise 1 -----------------------------------------
fib :: Integer -> Integer
fib 0 = 0
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)
fibs1 :: [Integer]
fibs1 = fib `map` [0..]
-- Exe... | kemskems/cis194-spring13 | src/HW06/HW06.hs | Haskell | bsd-3-clause | 2,524 |
{-# language DataKinds #-}
{-# language FlexibleInstances #-}
import Control.Monad ( unless )
import qualified OpenCV as CV
import OpenCV.TypeLevel
import OpenCV.VideoIO.Types
main :: IO ()
main = do
cap <- CV.newVideoCapture
-- Open the first available video capture device. Usually the
-- webcam if run o... | lukexi/haskell-opencv | examples/src/videoio.hs | Haskell | bsd-3-clause | 1,376 |
-- -----------------------------------------------------------------------------
--
-- (c) The University of Glasgow, 2011
--
-- Generate code to initialise cost centres
--
-- -----------------------------------------------------------------------------
module Eta.Profiling.ProfInit (profilingInitCode) where
import E... | rahulmutt/ghcvm | compiler/Eta/Profiling/ProfInit.hs | Haskell | bsd-3-clause | 1,654 |
module Tests.TestSuiteTasty where
import System.Exit (exitFailure)
import System.Environment (lookupEnv)
import qualified Tests.Parser as P
import qualified Tests.TypeCheck as TC
import qualified Tests.Simplify as S
import qualified Tests.Disintegrate as D
import qualified Tests.Sample as E
import ... | zachsully/hakaru | haskell/Tests/TestSuiteTasty.hs | Haskell | bsd-3-clause | 1,465 |
{-| Instance status data collector.
-}
{-
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. Redistributions of source code must retain the above copyright notice,
this... | apyrgio/ganeti | src/Ganeti/DataCollectors/InstStatus.hs | Haskell | bsd-2-clause | 7,407 |
<?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="sq-AL">
<title>Active Scan Rules - Alpha | ZAP Extension</title>
<maps>
<homeID>top</homeID>... | thc202/zap-extensions | addOns/ascanrulesAlpha/src/main/javahelp/org/zaproxy/zap/extension/ascanrulesAlpha/resources/help_sq_AL/helpset_sq_AL.hs | Haskell | apache-2.0 | 986 |
-- This example demonstrates the peril of trying to benchmark a
-- function that performs lazy I/O.
import Criterion.Main
main :: IO ()
main = defaultMain [
-- By using whnfIO, when the benchmark loop goes through an
-- iteration, we inspect only the first constructor returned after
-- the file is opened.... | paulolieuthier/criterion | examples/BadReadFile.hs | Haskell | bsd-2-clause | 653 |
module SchemeParse
( parseAtom
{-, parseString-}
, parseNumber
, parseExpr
, readExpr) where
import Control.Monad
import Text.ParserCombinators.Parsec hiding (spaces)
import SchemeDef
{-spaces :: Parser ()
spaces = skipMany1 space-}
symbol :: Parser Char
symbol = oneOf "!$%&|*+-/:<=>?@^_~"
pars... | phlip9/scheme-interpreter | SchemeParse.hs | Haskell | mit | 1,242 |
{-
Counting Sundays
Problem 19
You are given the following information, but you may prefer to do some research for yourself.
1 Jan 1900 was a Monday.
Thirty days has September,
April, June and November.
All the rest have thirty-one,
Saving February alone,
Which has twenty-eight, rain or shine.
And on leap years, twent... | feliposz/project-euler-solutions | haskell/euler19.hs | Haskell | mit | 2,405 |
module Main where
{-
pwr :: Integral a => a -> a -> a
pwr b e = pwr' b b e
pwr' :: Integral a => a -> a -> a -> a
pwr' acc b 1 = acc
pwr' acc b e = pwr' (acc*b) b (e-1)
x % y
| x < y = x
| x == y = 0
| otherwise = (x - y) % y
-}
result :: (Enum a, RealFloat a) => a
result = head [ a * b * sqrt (a * ... | ron-wolf/haskeuler | src/09.hs | Haskell | mit | 450 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.List.NonEmpty
import Language.SAL
main :: IO ()
main = putStrLn (renderSAL ctx)
ctx :: Context
ctx = Context "salctx" Nothing body
where
body = ContextBody (ModuleDecl salmod :| [])
salmod :: ModuleDeclaration
salmod =
let
ins = InputDecl ... | GaloisInc/language-sal | examples/salmod.hs | Haskell | mit | 769 |
module KMC.Syntax.ParserCombinators
( repetitions
, delims
, parens
, brackets
, braces
, suppressDelims
, parseTable
, nonGroupParens
, genParseTable
) where
import Control.Applicative hiding (many)
import Text.ParserCombinators.Parsec (choice, count, many, many1,
... | diku-kmc/regexps-syntax | KMC/Syntax/ParserCombinators.hs | Haskell | mit | 3,169 |
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
module Y2018.M04.D09.Exercise where
import Data.Aeson
import Database.PostgreSQL.Simple
import Database.PostgreSQL.Simple.SqlQQ
{--
Okay, fam. We're going to wrap up our preparation for the data load by
parsing tags into a tags lookup table.
--}
-- below imports avail... | geophf/1HaskellADay | exercises/HAD/Y2018/M04/D09/Exercise.hs | Haskell | mit | 804 |
{-# LANGUAGE FlexibleContexts
, UndecidableSuperClasses #-}
module MiniSequel.Mapper
where
import MiniSequel
import MiniSequel.Expression ((=.), SequelExpression)
import Database.HDBC
import Data.Data
import Data.Char (toUpper, toLower, isUpper)
import Data.Maybe (fromJust)
import qualified ... | TachoMex/MiniSequel | src/MiniSequel/Mapper.hs | Haskell | mit | 2,283 |
{-|
Module: Y2015.D06
Description: Advent of Code Day 06 Solutions.
License: MIT
Maintainer: @tylerjl
Solutions to the day 06 set of problems for <adventofcode.com>.
-}
module Y2015.D06
( testA
, testB
, Instruction(..)
, Range(..)
, parseInstructions
, configureGridA
, configureGridB
, light... | tylerjl/adventofcode | src/Y2015/D06.hs | Haskell | mit | 4,087 |
-- | In this module, we model an /elementary topos/ with Haskell types
-- (see <https://en.wikipedia.org/wiki/Topos>).
-- To be more precise, we model the "smallest elementary topos with a
-- natural number object". Without such a natural number object,
-- the resulting topos would be boring, consisting merely of the f... | brunjlar/protop | src/Protop/Core.hs | Haskell | mit | 1,649 |
module Solidran.Hamm.DetailSpec (spec) where
import Test.Hspec
import Solidran.Hamm.Detail
spec :: Spec
spec = do
describe "Solidran.Hamm.Detail" $ do
describe "hammingDist" $ do
it "should work in the given sample" $ do
hammingDist "GAGCCTACTAACGGGAT" "CATCGTAATGACGGCCT"
... | Jefffrey/Solidran | test/Solidran/Hamm/DetailSpec.hs | Haskell | mit | 726 |
module System.Monitoring.Nrpe (
checkNRPE
, liftNRPE
, IONRPE
, NRPE
-- re-exports lower-level modules
, module System.Monitoring.Nrpe.Protocol
, module System.Monitoring.Nrpe.Nagios
) where
import Data.ByteString (ByteString)
import Control.Applicative ((<$>))
import System.Monitoring.Nrpe.Protoco... | lucasdicioccio/nrpe | src/System/Monitoring/Nrpe.hs | Haskell | apache-2.0 | 752 |
{-# LANGUAGE ViewPatterns #-}
module Language.K3.Codegen.CPP.Materialization.Common where
import Control.Arrow
import Data.Hashable
import Language.K3.Core.Annotation
import Language.K3.Core.Common
import Language.K3.Core.Expression
import Language.K3.Core.Type
rollLambdaChain :: K3 Expression -> ([(Identifier, K3 ... | DaMSL/K3 | src/Language/K3/Codegen/CPP/Materialization/Common.hs | Haskell | apache-2.0 | 1,095 |
{-
Copyright 2015 Tristan Aubrey-Jones
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 agreed to in writing, sof... | flocc-net/flocc | v0.1/Compiler/Back/TypeNames.hs | Haskell | apache-2.0 | 8,904 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QGraphicsItemGroup_h.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:25
Warning : this file is machine generat... | keera-studios/hsQt | Qtc/Gui/QGraphicsItemGroup_h.hs | Haskell | bsd-2-clause | 98,747 |
module Handler.View where
import Import
import Handler.Markdown (renderMarkdown)
getViewR :: NoteId -> Handler RepHtml
getViewR noteId = do
note <- runDB $ get404 noteId
defaultLayout $ do
setTitle (toHtml $ noteTitle note)
let markdown = renderMarkdown (unTextarea $ noteText note)
$(widgetFile "view"... | MasseR/introitu | Handler/View.hs | Haskell | bsd-2-clause | 322 |
module Permutations where
import Data.List (delete, nub)
-- | List all permutations of a list (4 kyu)
-- | Link: https://biturl.io/Permutations
-- | My original solution
permutations :: Eq a => [a] -> [[a]]
permutations [] = [[]]
permutations xs = nub [x : ys | x <- xs, ys <- permutations (delete x xs)]
| Eugleo/Code-Wars | src/combinatorics-kata/Permutations.hs | Haskell | bsd-3-clause | 308 |
{-# LANGUAGE OverloadedStrings #-}
module Main ( main ) where
import Control.Applicative ((<$>))
import Control.Monad (forever, mzero)
import Control.Monad.Trans (liftIO)
import Control.Monad.IO.Class (MonadIO)
import Control.Concurrent (forkIO, ThreadId)
im... | rvion/chrome-reloader | src/Main.hs | Haskell | bsd-3-clause | 2,454 |
{-
Copyright (c) 2014-2015, Johan Nordlander, Jonas Duregård, Michał Pałka,
Patrik Jansson and Josef Svenningsson
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistribu... | josefs/autosar | oldARSim/Main.hs | Haskell | bsd-3-clause | 2,812 |
module HaskellCI.Config.Jobs where
import HaskellCI.Prelude
import qualified Distribution.Compat.CharParsing as C
import qualified Distribution.Parsec as C
import qualified Distribution.Pretty as C
import qualified Text.PrettyPrint as PP
-- | Jobs
--
-- * @N:M@ - @N@ ghcs (caba... | hvr/multi-ghc-travis | src/HaskellCI/Config/Jobs.hs | Haskell | bsd-3-clause | 1,460 |
-- {-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE ExplicitForAll #-}
--{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
-- {-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
--{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE RankNTypes #-}
--{-# LANGUAGE RebindableSyntax... | LATBauerdick/fv.hs | src/FV/Fit.hs | Haskell | bsd-3-clause | 7,151 |
{-# OPTIONS -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- fo... | nomeata/ghc | compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs | Haskell | bsd-3-clause | 2,590 |
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-@ LIQUID "--no-termination "@-}
import LiquidHaskell
import Language.Haskell.Liquid.Prelude
import Prelude hiding (sum, length, (!!), Functor(..))
import qualified Prelude as P
[lq| qualif Size(v:int, xs:a): v = (size xs) |]
[lq| data List a = N... | spinda/liquidhaskell | tests/gsoc15/unknown/pos/Class.hs | Haskell | bsd-3-clause | 2,007 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Provides operations for BitFields that are used in the protocol.
module Network.BitTorrent.BitField (
BitField(..)
, newBitField
, get
, set
, completed
, toPWP
) where
import Control.DeepSeq
import Data.Bits
impo... | farnoy/torrent | src/Network/BitTorrent/BitField.hs | Haskell | bsd-3-clause | 2,400 |
-- | contains a prettyprinter for the
-- Template Haskell datatypes
module Language.Haskell.TH.Ppr where
-- All of the exports from this module should
-- be "public" functions. The main module TH
-- re-exports them all.
import Text.PrettyPrint (render)
import Language.Haskell.TH.PprLib
import Language.Ha... | GaloisInc/halvm-ghc | libraries/template-haskell/Language/Haskell/TH/Ppr.hs | Haskell | bsd-3-clause | 28,065 |
{-# LANGUAGE CPP, BangPatterns #-}
{-# OPTIONS -Wall #-}
-----------------------------------------------------------------------------
-- |
-- Module : Language.CFamily.Data.InputStream
-- Copyright : (c) 2008,2011 Benedikt Huber
-- License : BSD-style
-- Maintainer : benedikt.huber@gmail.com
-- Stabili... | micknelso/language-c | src/Language/CFamily/Data/InputStream.hs | Haskell | bsd-3-clause | 2,994 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE FlexibleInstances, ViewPatterns #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.HyperDex.Client
-- Copyright : (c) Aaron Friel 2013
-- License : BSD-style
-- Maintainer : mayreply@aaronfriel.com
-... | AaronFriel/hyhac | src/Database/HyperDex/Utf8.hs | Haskell | bsd-3-clause | 2,349 |
module Automata where
import Sets
-- Estrutura de um automato finito nao deterministico
data Nfa a = NFA (Set a)
(Set (Move a))
a
(Set a)
deriving (Eq, Show)
--
data Move a = Move a Char a
|Emove a a
deriving (Eq, Ord... | arthurmgo/regex-ftc | src/Automata.hs | Haskell | bsd-3-clause | 2,764 |
module DropNth where
--(Problem 16) Drop every N'th element from a list.
dropNth :: [a] -> Int -> [a]
dropNth [] _ = []
dropNth y@(x:xs) n = (take (n - 1) y) ++ dropNth (drop 2 xs) n
| michael-j-clark/hjs99 | src/11to20/DropNth.hs | Haskell | bsd-3-clause | 188 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | See "Control.Monad.Ether.Reader".
module Control.Monad.Ether.Implicit.Reader
(
-- * MonadReader class
MonadReader
, local
, ask
, reader
, asks
-- * The Reader monad
, Reader
, runReader
-- * The R... | bitemyapp/ether | src/Control/Monad/Ether/Implicit/Reader.hs | Haskell | bsd-3-clause | 1,690 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Data.MessagePack.Types.Instances () where
import Data.Void (Void)
import Data.MessagePack.Types.Class (MessagePack)
import Data.MessagePack.Types.Generic ()
instance MessagePack a => MessagePack (Maybe a)
instance (Me... | SX91/hs-msgpack-types | src/Data/MessagePack/Types/Instances.hs | Haskell | bsd-3-clause | 403 |
{-# LANGUAGE DoRec #-}
module LazyRec where
import Control.Monad.Trans.Writer
import Data.Maybe
type Symbol = String
type Line = Int
type SymData = (Symbol, Line)
type Stmt = (SymData, [String])
type Prog = [Stmt]
prog :: Prog
prog =
[ (("alma", 1), ["korte", "alma"])
, (("korte", 2), ["szilva"])
, (("szilva",... | robinp/haskell-toys | src/Toys/LazyRec.hs | Haskell | bsd-3-clause | 1,248 |
module Win32Font
{-
( CharSet
, PitchAndFamily
, OutPrecision
, ClipPrecision
, FontQuality
, FontWeight
, createFont, deleteFont
, StockFont, getStockFont
, oEM_FIXED_FONT, aNSI_FIXED_FONT, aNSI_VAR_FONT, sYSTEM_FONT
, dEVICE_DEFAULT_FONT, sYSTEM_FIXED_FONT
) where
-}
where
import StdDIS
import Win32Typ... | OS2World/DEV-UTIL-HUGS | libraries/win32/Win32Font.hs | Haskell | bsd-3-clause | 14,409 |
module Simplify where
import Prelude hiding (pi, abs)
import Lang.LF
import Terms
import qualified Debug.Trace as Debug
data BindData (γ :: Ctx *) where
BindEmpty :: BindData E
BindLetcont :: BindData γ
-> LF γ TERM {- :: v ==> term -}
-> BindData (γ ::> b)
Bin... | robdockins/canonical-lf | toyml/Simplify.hs | Haskell | bsd-3-clause | 13,373 |
module B1.Program.Chart.TaskManager
( TaskManager
, newTaskManager
) where
data TaskManager = TaskManager (IORef [IO ()])
newTaskManager :: IO TaskManager
newTaskManager = do
workQueue <- newIORef []
return $ TaskManager workQueue
| madjestic/b1 | src/B1/Program/Chart/ThreadManager.hs | Haskell | bsd-3-clause | 244 |
{-# LANGUAGE FlexibleInstances,FlexibleContexts,MultiWayIf,CPP #-}
module Herbie.MathInfo
where
import Class
import DsBinds
import DsMonad
import ErrUtils
import GhcPlugins hiding (trace)
import Unique
import MkId
import PrelNames
import UniqSupply
import TcRnMonad
import TcSimplify
import Type
import Control.Mon... | mikeizbicki/HerbiePlugin | src/Herbie/MathInfo.hs | Haskell | bsd-3-clause | 11,357 |
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
module Hakyll.Core.Rules.Tests
( tests
) where
--------------------------------------------------------------------------------
import Data.IORef (IORef, newIORef, ... | Minoru/hakyll | tests/Hakyll/Core/Rules/Tests.hs | Haskell | bsd-3-clause | 3,836 |
{-# LANGUAGE TypeInType, ScopedTypeVariables, TypeOperators, GADTs #-}
{-# OPTIONS_GHC -Wno-overlapping-patterns #-} -- don't want erroneous warning in test output
-- if removing this doesn't change output, then
-- remove it!... | ezyang/ghc | testsuite/tests/typecheck/should_compile/T13337.hs | Haskell | bsd-3-clause | 602 |
{-# LANGUAGE MagicHash, UnboxedTuples #-}
module Main ( main ) where
import GHC.Exts
import GHC.Prim
import GHC.ST
main = putStr
(test_sizeofArray
++ "\n" ++ test_sizeofMutableArray
++ "\n"
)
test_sizeofArray :: String
test_sizeofArray = flip shows "\n" $ runST $ ST $ \ s# -> go 0 [] s... | hferreiro/replay | testsuite/tests/codeGen/should_run/cgrun065.hs | Haskell | bsd-3-clause | 982 |
module Parse (parse, parseExpr, lexSynonym) where
import Text.Parsec hiding (parse)
import qualified Text.Parsec as P
import Text.Parsec.String (Parser)
import LambdaWithSynonyms (Expr'(..))
import Data.Functor ((<$>))
import Control.Arrow (left)
import Control.Applicative ((<*))
parse :: String -> Either String Expr... | hughfdjackson/abattoir | src/Parse.hs | Haskell | mit | 1,234 |
{-# OPTIONS -Wall #-}
{-# LANGUAGE TupleSections #-}
import qualified Data.List as List
import qualified Data.Map.Strict as Map
import qualified Data.Maybe as Maybe
import Data.Set (Set)
import qualified Data.Set as Set
import Helpers.Function
import Helpers.Grid (Grid, Point)
import qualified Helpers.Grid as Grid
ma... | SamirTalwar/advent-of-code | 2021/AOC_11_2.hs | Haskell | mit | 1,308 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE DeriveGeneric #-}
-- | simple haskell interface for freetype2
--
-- for error codes: https://hackage.haskell.org/package/freetype2-0.1.1/src/include/freetype/fterrdef.h
module Graphics.Font
( module Gr... | MaxDaten/typography-ft2 | Graphics/Font.hs | Haskell | mit | 2,801 |
-- A Gift Well Spent
-- http://www.codewars.com/kata/54554846126a002d5b000854/
module Gift where
buy :: (Num a, Eq a) => a -> [a] -> Maybe (Int, Int)
buy c is = if null cs then Nothing else Just (head cs)
where cs = [(i, j) | i<-[0..length is - 1], j <- drop i [1..length is - 1], is!!i + is!!j == c]
| gafiatulin/codewars | src/7 kyu/Gift.hs | Haskell | mit | 308 |
module Y2017.M07.D26.Exercise where
import Control.Monad.State
import Data.Map (Map)
-- below import available via 1HaskellADay git repository
import Relational.Scheme.Types
{--
Unification and freshness for today.
So, yesterday, we saw how to unify two atoms and how that reduced to lifting
their equivalence into ... | geophf/1HaskellADay | exercises/HAD/Y2017/M07/D26/Exercise.hs | Haskell | mit | 3,957 |
{-# LANGUAGE DataKinds, MultiParamTypeClasses, FunctionalDependencies, TypeOperators, PolyKinds, TypeFamilies, FlexibleInstances, ScopedTypeVariables, UndecidableInstances, DefaultSignatures, FlexibleContexts #-}
{-# OPTIONS_HADDOCK prune #-}
module Data.MZip where
import Data.MGeneric
import Data.Unapply
import Dat... | RafaelBocquet/haskell-mgeneric | src/Data/MZip.hs | Haskell | mit | 12,658 |
{-# LANGUAGE TypeFamilies, QuasiQuotes, TemplateHaskell, MultiParamTypeClasses, OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module YesodCoreTest.ErrorHandling
( errorHandlingTest
, Widget
) where
import Yesod.Core
import Test.Hspec
import Network.Wai
import Network.Wai.Test
import Text.Hamlet... | piyush-kurur/yesod | yesod-core/test/YesodCoreTest/ErrorHandling.hs | Haskell | mit | 3,811 |
-- |
-- Module: Math.NumberTheory.Primes.Testing.Probabilistic
-- Copyright: (c) 2011 Daniel Fischer, 2017 Andrew Lelechenko
-- Licence: MIT
-- Maintainer: Daniel Fischer <daniel.is.fischer@googlemail.com>
--
-- Probabilistic primality tests, Miller-Rabin and Baillie-PSW.
{-# LANGUAGE BangPatterns #... | cartazio/arithmoi | Math/NumberTheory/Primes/Testing/Probabilistic.hs | Haskell | mit | 9,084 |
import Data.List
import Data.List.Split
import Data.Maybe
import System.IO
import Data.Char
import qualified AStar
main = do
contents <- readFile "day11input.txt"
let result = compute $ lines contents
print result
type Pair = (Int, Int) -- (Floor of microchip, Floor of gene... | aBhallo/AoC2016 | Day 11/day11part2.hs | Haskell | mit | 3,004 |
{-# LANGUAGE TupleSections, OverloadedStrings #-}
module Handler.Delete where
import Data.Maybe
import qualified Data.Map as M
import qualified Data.Text as T
import Text.Parsec
import Text.Parsec.Error
import qualified Text.BibTeX.Parse as BibP
import qualified Text.BibTeX.Format as BibF
import Yesod.Markdown
import... | klarh/barch | Handler/Delete.hs | Haskell | mit | 1,469 |
module Language.Binal.Verifier where
import Control.Applicative
import Control.Monad
import Control.Monad.State
import Control.Lens
import qualified Data.Maybe as Maybe
import qualified Data.List as List
import qualified Data.HashSet as HashSet
import q... | pasberth/binal1 | Language/Binal/Verifier.hs | Haskell | mit | 26,883 |
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
import Data.Monoid (mappend)
import Hakyll
--------------------------------------------------------------------------------
main :: IO ()
main = hakyll $ do
match "images/*" $ do... | prannayk/Hakyll-Blog | site.hs | Haskell | mit | 2,284 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
{-# OPTI... | lambdacms/lambdacms.org | lambdacmsorg-tutorial/LambdaCmsOrg/Tutorial/Foundation.hs | Haskell | mit | 3,035 |
module Main where
-- import Control.Monad ( (<<) )
import System( getArgs )
import System.IO( stderr, hPutStrLn )
import System.Process( runCommand, waitForProcess)
import Data.List( nub, sort, isPrefixOf )
main = do args <- getArgs
if (length args >= 2) then
do let file = head args
... | spockz/Haskell-Code-Completion-for-TextMate | Main.hs | Haskell | mit | 904 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StaticPointers #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE BangPatterns #-}
module Driver (
tests
) where
import Test.Framework (Test, testGroup)
import Test.HUnit hiding (Test)
import Test.Framework.Providers.HUnit (testCase)
import CodeWorld
import CodeWorld.D... | pranjaltale16/codeworld | codeworld-api/test/Driver.hs | Haskell | apache-2.0 | 1,290 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- :script test/Spark/Core/Internal/PathsSpec.hs
module Spark.Core.Internal.PathsSpec where
import Test.Hspec
import qualified Data.Map.Strict as M
import qualified Data.Set as S
import qualified Data.ByteString.Char8 ... | krapsh/kraps-haskell | test/Spark/Core/Internal/PathsSpec.hs | Haskell | apache-2.0 | 6,446 |
module NLP.TAG.Vanilla.SubtreeSharing.Tests where
import Control.Applicative ((<$>))
import qualified Data.Set as S
import Test.Tasty (TestTree, testGroup) -- , localOptions)
import Test.HUnit (Assertion, (@?=))
import Test.Tasty.HUnit (testCase)
import NLP.TAG.Va... | kawu/tag-vanilla | src/NLP/TAG/Vanilla/SubtreeSharing/Tests.hs | Haskell | bsd-2-clause | 3,252 |
{-# LANGUAGE OverloadedStrings #-}
module Radiation.Parsers.Internal.CStyle where
import Data.Attoparsec.ByteString.Char8 as BP
import Data.Attoparsec.ByteString.Lazy as Lazy
import qualified Data.Attoparsec.ByteString as BB
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BSL
import qu... | jrahm/Radiation | src/Radiation/Parsers/Internal/CStyle.hs | Haskell | bsd-2-clause | 4,032 |
-- | The Ox monad facilitates writing functional expressions over the
-- input sentence with arbitrary type of sentence token.
module Control.Monad.Ox
(
-- * Types
Ox
, Id
-- * Functions
, save
, saves
, when
, whenJT
, group
-- * Ox monad execution
, execOx
-- * Utilities
, atWith
, atsWith
) where
import Cont... | kawu/monad-ox | Control/Monad/Ox.hs | Haskell | bsd-2-clause | 4,293 |
{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies #-}
{-# LANGUAGE OverloadedStrings #-}
module Tap
( Tap (..)
, TapRoute (..)
, resourcesTap
, Handler
, Widget
, module Yesod.Core
, module Settings
, StaticRoute (..)
, lift
, liftIO
) where
import Tap.Redis
import Yes... | KirinDave/redis-conduit | Tap.hs | Haskell | bsd-2-clause | 3,858 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QTextDocument_h.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:28
Warning : this file is machine generated - ... | keera-studios/hsQt | Qtc/Gui/QTextDocument_h.hs | Haskell | bsd-2-clause | 28,767 |
module NametableSpec where
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Monadic
import Test.Test
import Grin.Nametable
import Grin.Pretty
runTests :: IO ()
runTests = hspec spec
spec :: Spec
spec = do
describe "Property" $ do
it "restore . convert == id" $ property $
forAll genProg $ ... | andorp/grin | grin/test/NametableSpec.hs | Haskell | bsd-3-clause | 400 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module TitleScene (
titleScene
) where
import GameEngine.Scene
import GameEngine.Sprite
import GameEngine.Sprite.Label
import GameEngine.Sprite.Colored
import Control.Lens
import Control.Monad (when)
import Control.Monad.IO.Class
import Control.Monad.S... | lotz84/SnakeGameHaskell | src/TitleScene.hs | Haskell | bsd-3-clause | 2,381 |
import Language.Haskell.TH
putLeftRight :: Int -> ExpQ -> ExpQ
putLeftRight 0 ex = leftE `appE` ex
putLeftRight n ex = rightE `appE` putLeftRight (n - 1) ex
rightE, leftE :: ExpQ
rightE = conE $ mkName "Right"
leftE = conE $ mkName "Left"
reduce :: Either Int (Either String (Either Char ()))
-> Either Int (Either S... | YoshikuniJujo/papillon | test/templateHaskell/leftRight.hs | Haskell | bsd-3-clause | 509 |
{-|
Copyright : (c) Dave Laing, 2017
License : BSD3
Maintainer : dave.laing.80@gmail.com
Stability : experimental
Portability : non-portable
-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAG... | dalaing/type-systems | src/Rules/Kind/Infer/SyntaxDirected.hs | Haskell | bsd-3-clause | 1,701 |
{-# LANGUAGE GADTs, MultiParamTypeClasses, FlexibleInstances, Rank2Types, PolyKinds, UndecidableInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.Indexed.Free
-- Copyright : (C) 2013 Fumiaki Kinoshita
-- License : BSD-style (see the ... | fumieval/indexed-free | Control/Monad/Indexed/Free.hs | Haskell | bsd-3-clause | 1,914 |
{-# LANGUAGE TypeFamilies, TypeOperators, TupleSections #-}
{-# OPTIONS_GHC -Wall #-}
----------------------------------------------------------------------
-- |
-- Module : FunctorCombo.Holey
-- Copyright : (c) Conal Elliott 2010
-- License : BSD3
--
-- Maintainer : conal@conal.net
-- Stability : e... | conal/functor-combo | src/FunctorCombo/DHoley.hs | Haskell | bsd-3-clause | 5,280 |
{-# LANGUAGE
OverloadedStrings
, FlexibleContexts
#-}
module Application where
import Template.Main (htmlLight, page)
import Application.Types (MonadApp)
import Network.Wai.Trans (ApplicationT, MiddlewareT)
import Network.Wai (pathInfo)
import Network.Wai.Middleware.ContentType
import Network.Wai.Middleware.... | Debatable-Online/backend | src/Application.hs | Haskell | bsd-3-clause | 917 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
Handles @deriving@ clauses on @data@ declarations.
-}
{-# LANGUAGE CPP #-}
module TcDeriv ( tcDeriving, DerivInfo(..), mkDerivInfos ) where
#include "HsVersions.h"
import HsSyn
import DynFlags
import TcRnMonad
import ... | mcschroeder/ghc | compiler/typecheck/TcDeriv.hs | Haskell | bsd-3-clause | 96,356 |
module Test where
import Data.List
main :: IO ()
main = return ()
f::(Ord b, Show b, Eq a) => b -> a
f = undefined
| sebastiaanvisser/ghc-goals | tests/Test.hs | Haskell | bsd-3-clause | 120 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
TcSplice: Template Haskell splices
-}
{-# LANGUAGE CPP, FlexibleInstances, MagicHash, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module TcSplice(
-- These functions are defined in stage1 and stage... | gcampax/ghc | compiler/typecheck/TcSplice.hs | Haskell | bsd-3-clause | 63,028 |
module Main where
import System.Environment
import Server
main :: IO ()
main = do
args <- getArgs
if length args /= 1
then putStr help
else case args of
[cfg] -> startServer cfg
_ -> putStr help
-- | Help message
help :: String
help = "Students Big Brother Server v0.1.0 \n\
\Usage: \... | geo2a/students-big-brother | students-big-brother-server/app/Main.hs | Haskell | bsd-3-clause | 385 |
{-# LANGUAGE TemplateHaskell #-}
module Client.CEntityT where
import Control.Lens (makeLenses)
import Linear (V3(..))
import Game.EntityStateT
import Types
makeLenses ''CEntityT
newCEntityT :: CEntityT
newCEntityT = CEntityT
{ _ceBaseline = newEntitySta... | ksaveljev/hake-2 | src/Client/CEntityT.hs | Haskell | bsd-3-clause | 539 |
{-|
Module : $Header$
Description : Adapter for communicating with Slack via the webhook based Events API
Copyright : (c) Justus Adam, 2016
License : BSD3
Maintainer : dev@justus.science
Stability : experimental
Portability : POSIX
See http://marvin.readthedocs.io/en/latest/adapters.html#events-api for d... | JustusAdam/marvin | src/Marvin/Adapter/Slack/EventsAPI.hs | Haskell | bsd-3-clause | 4,540 |
{-# LANGUAGE OverloadedStrings #-}
module Image_Loader where
import Graphics.Blank
import Wiki -- (578,400)
main :: IO ()
main = do
blankCanvas 3000 $ \ context -> do
url1 <- staticURL context "type/jpeg" "images/Haskell.jpg"
url2 <- staticURL context "type/jpeg" "images/House.jpg"
send co... | ku-fpg/blank-canvas | wiki-suite/Image_Loader.hs | Haskell | bsd-3-clause | 584 |
#!/usr/bin/runghc
import Distribution.Simple
main = defaultMain
| baldo/derive-trie | Setup.hs | Haskell | bsd-3-clause | 65 |
module Deflisp.Core.Show where
import Deflisp.Core.Types
import Debug.Trace
import qualified Data.Map as Map
instance Show LispFunk where
show (LibraryFunction name _) = "library function: " ++ name
show (VarArgFunction _ _ _ _) = "vararg function"
show (UserFunction _ _ _) = "user function"
show (Macros _ _)... | ifesdjeen/deflisp | src/DefLisp/Core/Show.hs | Haskell | bsd-3-clause | 1,361 |
module Language
( initialInterpreterState
, parse
, interpret
, setInterpreterVariables
, updateSystemVars
, module Language.Ast
) where
import Control.Monad ( forM_ )
import Control.Monad.Trans ( liftIO )
import qualified Data.Map.Strict as M... | rumblesan/improviz | src/Language.hs | Haskell | bsd-3-clause | 3,026 |
module System.Build.Access.Version where
class Version r where
setVersion ::
r
-> r
unsetVersion ::
r
-> r
| tonymorris/lastik | System/Build/Access/Version.hs | Haskell | bsd-3-clause | 130 |
{-# LANGUAGE JavaScriptFFI #-}
module GHCJS.Three.HasName
(HasName(..)
) where
import GHCJS.Types
import GHCJS.Three.Monad
import Data.JSString (pack, unpack)
-- | get name
foreign import javascript unsafe "($1)['name']"
thr_getName :: JSVal -> Three JSString
-- | set name
foreign import javascript unsaf... | manyoo/ghcjs-three | src/GHCJS/Three/HasName.hs | Haskell | bsd-3-clause | 605 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeFamilies #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Lens.Equality
-- Copyright : (C) 2012-14 Edward Kmett
-- License : BSD-style (see the file LICENSE)
-... | hvr/lens | src/Control/Lens/Equality.hs | Haskell | bsd-3-clause | 2,358 |
module Distribution.Client.Dependency.Modular
( modularResolver, SolverConfig(..)) where
-- Here, we try to map between the external epm solver
-- interface and the internal interface that the solver actually
-- expects. There are a number of type conversions to perform: we
-- have to convert the package indi... | typelead/epm | epm/Distribution/Client/Dependency/Modular.hs | Haskell | bsd-3-clause | 2,611 |
{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-2006
\section[RnEnv]{Environment manipulation for the renamer monad}
-}
{-# LANGUAGE CPP, MultiWayIf #-}
module RnEnv (
newTopSrcBinder,
lookupLocatedTopBndrRn, lookupTopBndrRn,
lookupLocatedOccRn, lookupOccRn, lookupOccRn_maybe,
... | tjakway/ghcjvm | compiler/rename/RnEnv.hs | Haskell | bsd-3-clause | 97,750 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
module Test.Pos.Chain.Txp.Bi
( tests
) where
import Universum
import qualified Data.Map as M
import Data.Typeable (typeRep)
import Hedgehog (Gen, Property)
import qualified Hedgehog as H
import qualified H... | input-output-hk/pos-haskell-prototype | chain/test/Test/Pos/Chain/Txp/Bi.hs | Haskell | mit | 12,445 |
module Examples.UsablePath
( upExamples
) where
import Utils
import Algebra.Matrix
import Algebra.Semiring
import Algebra.Optimum
import Policy.UsablePath
upExamples :: Int -> Matrix UsablePath
upExamples 0 = M (toArray 5 [(U 0), (U 0), (U 0), (U 1), (U 0)
,(U 0), (U 0), (U 0), (U 1), (U 0)
... | sdynerow/Semirings-Library | haskell/Examples/UsablePath.hs | Haskell | apache-2.0 | 1,609 |
<?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="pl-PL">
<title>Customizable HTML Report</title>
<maps>
<homeID>top</homeID>
<mapref lo... | veggiespam/zap-extensions | addOns/customreport/src/main/javahelp/org/zaproxy/zap/extension/customreport/resources/help_pl_PL/helpset_pl_PL.hs | Haskell | apache-2.0 | 973 |
module HermBanded
where
import Driver
import Monadic
import qualified Test.QuickCheck.BLAS as Test
import Data.Matrix.Herm
import Data.Matrix.Banded
import Data.Vector.Dense
import Data.Vector.Dense.ST
import Data.Matrix.Dense.ST
import Test.Matrix.Herm.Banded
type V = Vector E
type B = Banded E
type HB = Herm... | patperry/hs-linear-algebra | tests-old/HermBanded.hs | Haskell | bsd-3-clause | 2,038 |
{-# LANGUAGE Rank2Types, FlexibleContexts #-}
module Tests.Utils
where
import Data.Word
import Control.Monad.ST
import Foreign.C.Error
import System.Directory
import System.IO
import System.IO.Unsafe (unsafePerformIO)
import System.FilePath
import Test.QuickCheck hiding (numTests)
import Test.QuickCheck.Monadic
impo... | hackern/halfs | test/src/Tests/Utils.hs | Haskell | bsd-3-clause | 11,787 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.