code stringlengths 5 1.03M | repo_name stringlengths 5 90 | path stringlengths 4 158 | license stringclasses 15
values | size int64 5 1.03M | n_ast_errors int64 0 53.9k | ast_max_depth int64 2 4.17k | n_whitespaces int64 0 365k | n_ast_nodes int64 3 317k | n_ast_terminals int64 1 171k | n_ast_nonterminals int64 1 146k | loc int64 -1 37.3k | cycloplexity int64 -1 1.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# LANGUAGE NoImplicitPrelude #-}
-- |
-- Module: $HEADER$
-- Description: Concrete proxies for types from Data.Word
-- Copyright: (c) 2014, Peter Trško
-- License: BSD3
--
-- Maintainer: peter.trsko@gmail.com
-- Stability: experimental
-- Portability: NoImplicitPrelude
--
-- Concrete proxies for ... | trskop/type-proxies | src/Data/Proxy/Word.hs | bsd-3-clause | 980 | 0 | 6 | 213 | 147 | 96 | 51 | 25 | 1 |
{-# LANGUAGE TupleSections #-}
{-@ LIQUID "--cabaldir" @-}
{-@ LIQUID "--diff" @-}
import Data.Maybe
import Data.Monoid (mconcat, mempty)
import System.Exit
import Control.Applicative ((<$>))
import Control.DeepSeq
import Text.PrettyPrint.HughesPJ
... | Kyly/liquidhaskell | Liquid.hs | bsd-3-clause | 4,468 | 3 | 16 | 1,376 | 1,124 | 577 | 547 | 82 | 2 |
module Santa where
import Control.Concurrent.STM
import Control.Concurrent
import System.Random
import Control.Concurrent.MVar
meetInStudy :: Int -> IO ()
meetInStudy id = putStrLn ("Elf " ++ show id ++ " is meeting in the study.")
deliverToys :: Int -> IO ()
deliverToys id = putStrLn ("Reindeer " ++ show id ++ " i... | aztecrex/haskell-experiments-scratch | src/Santa.hs | bsd-3-clause | 2,980 | 0 | 12 | 695 | 1,304 | 631 | 673 | 93 | 1 |
{-# LANGUAGE OverloadedStrings, DeriveFunctor, ViewPatterns #-}
module Crawl.FloorItems (
SquareItems(..), knownItems, possiblyAny,
FloorItems, trackFloorItems, scanFloorItems,
wantItem, wantItemPickup,
butcherable, isBook, isRune
) where
import Control.Applicative ((<$>), (<*>), liftA2)
import Control.Mona... | rwbarton/rw | Crawl/FloorItems.hs | bsd-3-clause | 9,418 | 0 | 18 | 2,083 | 2,753 | 1,445 | 1,308 | 153 | 20 |
-- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_5_C
-- Print a Chessboard
-- input:
-- 3 4
-- 5 6
-- 3 3
-- 2 2
-- 1 1
-- 0 0
-- output:
-- #.#.
-- .#.#
-- #.#.
--
-- #.#.#.
-- .#.#.#
-- #.#.#.
-- .#.#.#
-- #.#.#.
--
-- #.#
-- .#.
-- #.#
--
-- #.
-- .#
--
-- #
--
import Control.Applicative
import qu... | ku00/aoj-haskell | src/ITP1_5_C.hs | bsd-3-clause | 975 | 0 | 12 | 282 | 315 | 173 | 142 | 20 | 2 |
{-# LANGUAGE RecordWildCards #-}
-- | EKG monitoring.
module Pos.Infra.Reporting.Ekg
( withEkgServer
, registerEkgMetrics
, EkgNodeMetrics (..)
, registerEkgNodeMetrics
) where
import Universum
import Node (Node)
import Node.Util.Monitor (registerMetrics)
import q... | input-output-hk/pos-haskell-prototype | infra/src/Pos/Infra/Reporting/Ekg.hs | mit | 1,484 | 0 | 9 | 317 | 281 | 163 | 118 | 34 | 1 |
{- scheduled activities
-
- Copyright 2013-2014 Joey Hess <id@joeyh.name>
-
- License: BSD-2-clause
-}
module Utility.Scheduled (
Schedule(..),
Recurrance(..),
ScheduledTime(..),
NextTime(..),
WeekDay,
MonthDay,
YearDay,
nextTime,
calcNextTime,
startTime,
fromSchedule,
fromScheduledTime,
toScheduled... | sjfloat/propellor | src/Utility/Scheduled.hs | bsd-2-clause | 11,697 | 142 | 18 | 2,453 | 4,382 | 2,220 | 2,162 | 325 | 18 |
{-# OPTIONS_GHC -Wall #-}
module Type.Unify (unify) where
import Control.Monad (zipWithM_)
import Control.Monad.Except (ExceptT, lift, liftIO, throwError, runExceptT)
import qualified Data.Map as Map
import qualified Data.UnionFind.IO as UF
import qualified AST.Variable as Var
import qualified Reporting.Region as R
i... | mgold/Elm | src/Type/Unify.hs | bsd-3-clause | 18,653 | 0 | 20 | 5,648 | 5,278 | 2,591 | 2,687 | 429 | 13 |
{-# LANGUAGE NoImplicitPrelude, MagicHash, ScopedTypeVariables, KindSignatures,
UnboxedTuples, FlexibleContexts, UnliftedFFITypes, TypeOperators,
AllowAmbiguousTypes, DataKinds, TypeFamilies #-}
-----------------------------------------------------------------------------
-- |
-- Module :... | rahulmutt/ghcvm | libraries/base/Java/Utils.hs | bsd-3-clause | 3,171 | 27 | 10 | 614 | 836 | 464 | 372 | -1 | -1 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1998
\section[DataCon]{@DataCon@: Data Constructors}
-}
{-# LANGUAGE CPP, DeriveDataTypeable #-}
module DataCon (
-- * Main data types
DataCon, DataConRep(..),
SrcStrictness(..), SrcUnpackedness(..),
... | mcschroeder/ghc | compiler/basicTypes/DataCon.hs | bsd-3-clause | 49,218 | 0 | 20 | 14,464 | 5,694 | 3,242 | 2,452 | 487 | 5 |
module Dotnet.System.Collections.IDictionaryEnumerator where
import Dotnet
import qualified Dotnet.System.Collections.DictionaryEntry
import qualified Dotnet.System.Object
data IDictionaryEnumerator_ a
type IDictionaryEnumerator a = Dotnet.System.Object.Object (IDictionaryEnumerator_ a)
foreign import dotnet
"meth... | alekar/hugs | dotnet/lib/Dotnet/System/Collections/IDictionaryEnumerator.hs | bsd-3-clause | 813 | 0 | 10 | 79 | 147 | 86 | 61 | -1 | -1 |
------------------------------------------------------------------------------
-- | The Heist snaplet makes it easy to add Heist to your application and use
-- it in other snaplets.
--
module Snap.Snaplet.Heist
(
-- * Heist and its type class
Heist
, HasHeist(..)
-- * Initializer Functions
-- $initializ... | sopvop/snap | src/Snap/Snaplet/Heist.hs | bsd-3-clause | 13,135 | 0 | 11 | 3,008 | 1,481 | 826 | 655 | 139 | 2 |
{-# OPTIONS -Wall #-}
-----------------------------------------------------------------------------
-- |
-- Module : CRoundtrip.hs (executable)
-- Copyright : (c) 2008 Benedikt Huber
-- License : BSD-style
-- Maintainer : benedikt.huber@gmail.com
--
-- This module is invoked just like gcc. It preprocess... | micknelso/language-c | test/src/CRoundTrip.hs | bsd-3-clause | 4,637 | 0 | 17 | 952 | 1,054 | 533 | 521 | 74 | 4 |
<?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="ro-RO">
<title>FuzzDB Files</title>
<maps>
<homeID>fuzzdb</homeID>
<mapref location="ma... | thc202/zap-extensions | addOns/fuzzdb/src/main/javahelp/help_ro_RO/helpset_ro_RO.hs | apache-2.0 | 960 | 77 | 66 | 156 | 407 | 206 | 201 | -1 | -1 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.PreProcess
-- Copyright : (c) 2003-2005, Isaac Jones, Malcolm Wallace
-- License : BSD3
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This defines a 'PreProces... | headprogrammingczar/cabal | Cabal/Distribution/Simple/PreProcess.hs | bsd-3-clause | 29,824 | 163 | 27 | 8,458 | 5,468 | 3,020 | 2,448 | 441 | 40 |
-----------------------------------------------------------------------------
--
-- (c) The University of Glasgow 2011
--
-- CmmLint: checking the correctness of Cmm statements and expressions
--
-----------------------------------------------------------------------------
{-# LANGUAGE GADTs, CPP #-}
module CmmLint (
... | urbanslug/ghc | compiler/cmm/CmmLint.hs | bsd-3-clause | 8,908 | 0 | 16 | 2,314 | 2,259 | 1,108 | 1,151 | 155 | 7 |
module Name
( Name -- :: *; Show, Eq, Ord, Hash
, (%) -- :: Name -> Int -> Name
, name, prim -- :: String -> Name
, strip -- :: Name -> Name
-- names
, vr, sk, dp, sp, tr, dm, un, df, el, eq
, isSimpleName
, isSkolemnName
, isEltName
, getIndex
)
where
{-
Paradox/Equinox -- ... | msakai/folkung | Haskell/Name.hs | mit | 2,500 | 0 | 8 | 562 | 536 | 289 | 247 | 56 | 1 |
module Dice.TestInstances where
import Test.QuickCheck
import Control.Monad.Random
import D20.Dice
instance Bounded Die where
minBound = Four
maxBound = Percentile
instance Random Die where
random g =
case randomR (fromEnum (minBound :: Die),fromEnum (maxBound :: Die)) g of
(r,g') -> (toEnum r,g')
... | elkorn/d20 | test/Properties/Dice/TestInstances.hs | mit | 486 | 0 | 10 | 99 | 190 | 105 | 85 | 16 | 0 |
{-# LANGUAGE NoImplicitPrelude #-}
module IHaskell.CSS (ihaskellCSS) where
import IHaskellPrelude
ihaskellCSS :: String
ihaskellCSS =
unlines
[
-- Custom IHaskell CSS
"/* Styles used for the Hoogle display in the pager */"
, ".hoogle-doc {"
, "display: block;"
, "padding-bottom: 1.... | gibiansky/IHaskell | src/IHaskell/CSS.hs | mit | 2,154 | 0 | 6 | 651 | 275 | 183 | 92 | 88 | 1 |
-- :l codes/haskell/Scene.hs
module Scene
where
import Geom
-- Camera
maxdepth = 9
vrp = [0.0, 0.0, (-20.0)]
xleft = (-12)
xright = 12
ytop = 9
ybottom = (-9)
swidth = 640
sheight = 480
dx = (xright - xleft) / swidth
dy = (ytop - ybottom) / sheight
xcoord px = xleft + (0.5 + px... | pnex2000/hastracer | Scene.hs | mit | 2,553 | 10 | 13 | 641 | 1,376 | 778 | 598 | 61 | 2 |
{- |
Module : $Header$
Description : The entrypoint of the application.
Author : Nils 'bash0r' Jonsson
Copyright : (c) 2015 Nils 'bash0r' Jonsson
License : MIT
Maintainer : aka.bash0r@gmail.com
Stability : unstable
Portability : non-portable (Portability is untested.)
The entrypoint of the ... | aka-bash0r/headergen | src/Main.hs | mit | 960 | 0 | 9 | 220 | 157 | 88 | 69 | 16 | 4 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TupleSections #-}
module Main (main) where
import Control.Monad.Writer (execWriter, tell)
import qualified Data.Configurator as Config
import Data.Text (Text)
import qualified Data.Text a... | abhinav/tbr | app/main.hs | mit | 4,729 | 0 | 13 | 1,417 | 1,091 | 573 | 518 | 97 | 10 |
module Triangle (TriangleType(..), triangleType) where
import Data.List (sort)
data TriangleType = Equilateral
| Isosceles
| Scalene
| Illegal
deriving (Eq, Show)
triangleType :: (Ord a, Num a) => a -> a -> a -> TriangleType
triangleType a b c |... | genos/online_problems | exercism/haskell/triangle/src/Triangle.hs | mit | 545 | 0 | 11 | 240 | 191 | 103 | 88 | 13 | 1 |
module Bindings.ESKit (OptimisationProblem(OptimisationProblem),
DistributionHandler(CMAHandler, SepCMAHandler, CSAHandler),
n, mu, lambda, fitnessFunction, distributionHandlerSettings,
optimize)
where
import qualified Bindings.ESKitLowlevel as LL
im... | A1kmm/bindings-eskit | src/Bindings/ESKit.hs | mit | 5,402 | 0 | 23 | 1,717 | 1,080 | 540 | 540 | 85 | 2 |
module Data.FixedWidth.LargeFile where
import qualified Data.Text as StrictText
import qualified Data.Text.Lazy as LazyText
import qualified Data.Text.Lazy.IO as LazyTextIO
import System.IO (Handle, IOMode(..), openFile)
hGetLines :: Handle -> IO [StrictText.Text]
hGetLines handle = do
lazyText <- LazyTextIO.hGetCo... | michaelochurch/fixedwidth-hs | Data/FixedWidth/LargeFile.hs | mit | 498 | 0 | 11 | 64 | 147 | 84 | 63 | 11 | 1 |
module Chapter05.Arith3Broken where
main :: IO ()
main = do
print (1 + 2)
print 10
--putStrLn 10
print (negate (-1))
print ((+) 5 blah)
where blah = negate 1
-- print x where x = (negate -1)
-- let x = (negate -1)
-- print x
-- print x where x = (negate -1)
-- print y whe... | brodyberg/LearnHaskell | HaskellProgramming.hsproj/Chapter05/Arith3Broken.hs | mit | 373 | 0 | 11 | 129 | 91 | 49 | 42 | 8 | 1 |
-- |
module Main where
triangle :: Int -> [Int]
triangle 1 = [1]
triangle 2 = [1, 1]
triangle n = let prev = triangle (n-1) in
(1:(map (\i -> prev !! i + prev !! (i+1)) [0,1..length prev-2])) ++ [1]
main :: IO ()
main = do
n <- readLn
mapM_ (\x -> let row = triangle x in
do mapM_ (putStr .... | jerryzh168/hackerrank | FunctionalProgramming/Recursion/PascalsTriangle.hs | mit | 391 | 0 | 20 | 129 | 228 | 119 | 109 | 12 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Y2017.M10.D09.Solution where
{--
So, 'yesterday' we saved our data out as JSON, read it back in, and then
visualized it. The data was the NYT article archive, and, doing that, we
saw we had a lot of data to visualize.
Today, let's par that down a smidge.
--}
import Control.... | geophf/1HaskellADay | exercises/HAD/Y2017/M10/D09/Solution.hs | mit | 3,424 | 0 | 11 | 513 | 326 | 199 | 127 | 25 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main
where
import qualified Data.ByteString.Char8 as B
import Control.Monad.State
import Data.Conduit
import Data.Conduit.Network
import Network.Socket (withSocketsDo)
-- Mostly from: http://www.yesodweb.com/blog/2014/03/network-conduit-async
main = do
putStrLn "--------... | stormont/conduit-examples | examples/conduit-101-04/Main.hs | mit | 1,356 | 0 | 19 | 251 | 293 | 132 | 161 | 37 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-domainname.html
module Stratosphere.Resources.ApiGatewayDomainName where
import Stratosphere.Resour... | frontrowed/stratosphere | library-gen/Stratosphere/Resources/ApiGatewayDomainName.hs | mit | 3,387 | 0 | 15 | 352 | 455 | 260 | 195 | 41 | 1 |
{-
Suggest better pragmas
OPTIONS_GHC -cpp => LANGUAGE CPP
OPTIONS_GHC -fglasgow-exts => LANGUAGE ... (in HSE)
OPTIONS_GHC -XFoo => LANGUAGE Foo
LANGUAGE A, A => LANGUAGE A
-- do not do LANGUAGE A, LANGUAGE B to combine
<TEST>
{-# OPTIONS_GHC -cpp #-} -- {-# LANGUAGE CPP #-}
{-# OPTIONS -cpp... | alphaHeavy/hlint | src/Hint/Pragma.hs | gpl-2.0 | 2,604 | 0 | 14 | 569 | 770 | 397 | 373 | 33 | 2 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_HADDOCK show-extensions #-}
-- |
-- Module : Yi.Editor
-- License : GPL-2
-- Maintainer : yi-devel@googlegroups.com
-- Stability : experimental
-- Portabilit... | atsukotakahashi/wi | src/library/Yi/Editor.hs | gpl-2.0 | 29,751 | 0 | 23 | 7,925 | 6,795 | 3,541 | 3,254 | -1 | -1 |
(a, e) -> b | hmemcpy/milewski-ctfp-pdf | src/content/3.7/code/haskell/snippet06.hs | gpl-3.0 | 11 | 1 | 5 | 3 | 15 | 7 | 8 | -1 | -1 |
-- | Primitive function definitions for HScheme.
--
-- Copyright 2008 Mats Klingberg
--
-- This file is part of hscheme and is licensed under the GNU GPL, see the
-- LICENSE file for the full license text.
module Primitives (
-- * Exported Haskell functions
getPrimitiveEnv
-- * Primitive Scheme functions
... | matkli/hscheme | Primitives.hs | gpl-3.0 | 4,313 | 0 | 12 | 940 | 1,123 | 625 | 498 | 61 | 1 |
lenAlg :: ListF e Int -> Int
lenAlg (ConsF e n) = n + 1
lenAlg NilF = 0 | hmemcpy/milewski-ctfp-pdf | src/content/3.8/code/haskell/snippet21.hs | gpl-3.0 | 71 | 0 | 7 | 18 | 43 | 21 | 22 | 3 | 1 |
{-# LANGUAGE NoImplicitPrelude, GeneralizedNewtypeDeriving, TypeFamilies #-}
module Lamdu.Sugar.Names.Get
( fromExpression, fromBody
) where
import Prelude.Compat
import Control.Monad.Trans.State (State, runState)
import qualified Control.Monad.Trans.State as State
import Lamdu.S... | da-x/lamdu | Lamdu/Sugar/Names/Get.hs | gpl-3.0 | 1,621 | 0 | 10 | 324 | 494 | 280 | 214 | 32 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | dysinger/amazonka | amazonka-cognito-sync/gen/Network/AWS/CognitoSync/UnsubscribeFromDataset.hs | mpl-2.0 | 4,607 | 0 | 9 | 1,022 | 563 | 341 | 222 | 73 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-run/gen/Network/Google/Resource/Run/Projects/Locations/Configurations/Get.hs | mpl-2.0 | 5,078 | 5 | 16 | 1,098 | 695 | 408 | 287 | 104 | 1 |
--
-- Copyright 2017-2018 Azad Bolour
-- Licensed under GNU Affero General Public License v3.0 -
-- https://github.com/azadbolour/boardgame/blob/master/LICENSE.md
--
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE DisambiguateRecordFields #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUA... | azadbolour/boardgame | haskell-server/src/Bolour/Plane/Domain/LineSegment.hs | agpl-3.0 | 1,686 | 0 | 10 | 336 | 299 | 178 | 121 | 29 | 2 |
module TinyThreePassCompiler where
import Data.List.Split
import Data.List
data AST = Imm Int
| Arg Int
| Add AST AST
| Sub AST AST
| Mul AST AST
| Div AST AST
deriving (Eq, Show)
--
data Production = FromToken Token
| Expression AST
... | ice1000/OI-codes | codewars/101-200/tiny-three-pass-compiler-also-give-up.hs | agpl-3.0 | 3,151 | 0 | 16 | 805 | 1,413 | 738 | 675 | 73 | 3 |
-- Copyright (c) 2013-2014 PivotCloud, Inc.
--
-- Aws.Lambda
--
-- Please feel free to contact us at licensing@pivotmail.com with any
-- contributions, additions, or other feedback; we would love to hear from
-- you.
--
-- Licensed under the Apache License, Version 2.0 (the "License"); you may
-- not use this file exce... | alephcloud/hs-aws-lambda | src/Aws/Lambda.hs | apache-2.0 | 1,881 | 0 | 5 | 196 | 216 | 161 | 55 | 27 | 0 |
--Final Project ALP.
--Student: Marcos Pividori
-- |This module presents the configuration of the database used and the types of data stored in it.
{-# LANGUAGE OverloadedStrings, TypeFamilies, TemplateHaskell,
QuasiQuotes, MultiParamTypeClasses, GeneralizedNewtypeDeriving, FlexibleContexts, GADTs #-}
m... | MarcosPividori/Yesod-server-for-GCM | DataBase.hs | apache-2.0 | 802 | 0 | 7 | 175 | 49 | 31 | 18 | 6 | 0 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TupleSections #-}
-- | A module responsible for identifying occurrences dictionary
-- entries in the Skladnica treebank.
module NLP.Skladnica.Map
( MapCfg (..)... | kawu/skladnica-with-walenty | src/NLP/Skladnica/Map.hs | bsd-2-clause | 6,928 | 8 | 20 | 1,748 | 1,415 | 778 | 637 | 121 | 6 |
{-# LANGUAGE ConstraintKinds, FlexibleContexts, FlexibleInstances,
MultiParamTypeClasses, TypeFamilies #-}
module HaskHOL.Core.Overloadings
( module HaskHOL.Core.Kernel
, module HaskHOL.Core.Basics
, module HaskHOL.Core.Parser
, module HaskHOL.Core.Overloadings
)
where
import HaskHOL... | ecaustin/haskhol-core | src/HaskHOL/Core/Overloadings.hs | bsd-2-clause | 18,394 | 0 | 12 | 3,982 | 5,731 | 3,000 | 2,731 | 305 | 1 |
{-# LANGUAGE InstanceSigs #-}
module Control.Effect.Parameterised.State where
-- Bye Monads... as we know them
import Prelude hiding (Monad(..))
import Control.Effect.Parameterised
newtype State s1 s2 a = State { runState :: s1 -> (a, s2) }
-- State parameterised monad
-- ... just like the
instance PMonad State whe... | dorchard/effect-monad | src/Control/Effect/Parameterised/State.hs | bsd-2-clause | 562 | 0 | 12 | 149 | 211 | 118 | 93 | 12 | 0 |
{-
- Driver file for running tests at a command line prompt. This is the standard
- pass-through to the test-framework package.
-
- Refer to CabalTest.hs for the setup used when running "cabal test".
-}
module Main (main) where
import Test.Framework (defaultMain)
import ChessTools.Test.Suite (tests)
main :: IO ... | malcolmt/chess-tools | src/ChessTools/Test/ConsoleTest.hs | bsd-3-clause | 349 | 0 | 6 | 63 | 49 | 29 | 20 | 5 | 1 |
{-# LANGUAGE RecordWildCards #-}
-- | read/write ImpulseTracker imstruments
module Codec.Tracker.IT.Instrument (
Instrument (..)
, Envelope (..)
, getInstrument
, putInstrument
) where
import Control.Monad
import Data.Binary
import Data.Binary.Get
import D... | riottracker/modfile | src/Codec/Tracker/IT/Instrument.hs | bsd-3-clause | 6,460 | 0 | 27 | 3,421 | 935 | 536 | 399 | 94 | 1 |
module ProjectEuler.Problem033 (solution033) where
import Data.Ratio
reductibleFractions :: [Ratio Integer]
reductibleFractions = [(10 * a + b) / (10 * b + c) | a <- [1..9], b <- [1..9], c <- [1..9], 9 * a * c + b * c == 10 * a * b]
solution033 :: Integer
solution033 = denominator $ product reductibleFractions
| guillaume-nargeot/project-euler-haskell | src/ProjectEuler/Problem033.hs | bsd-3-clause | 315 | 0 | 13 | 60 | 149 | 81 | 68 | 6 | 1 |
{-# LANGUAGE CPP #-}
module TcInteract (
solveSimpleGivens, -- Solves [Ct]
solveSimpleWanteds, -- Solves Cts
solveCallStack, -- for use in TcSimplify
) where
#include "HsVersions.h"
import BasicTypes ( infinity, IntWithInf, intGtLimit )
import HsTypes ( HsIPName(..) )
import TcCanonical
imp... | mcschroeder/ghc | compiler/typecheck/TcInteract.hs | bsd-3-clause | 89,059 | 48 | 22 | 26,640 | 12,788 | 6,647 | 6,141 | -1 | -1 |
{-# LANGUAGE PackageImports #-}
module Control.Monad.Zip (module M) where
import "base" Control.Monad.Zip as M
| silkapp/base-noprelude | src/Control/Monad/Zip.hs | bsd-3-clause | 116 | 0 | 4 | 18 | 23 | 17 | 6 | 3 | 0 |
{-# LANGUAGE TupleSections, OverloadedStrings, QuasiQuotes, TemplateHaskell, TypeFamilies, RecordWildCards,
DeriveGeneric ,MultiParamTypeClasses ,FlexibleInstances #-}
module Protocol.ROC.PointTypes.PointType89 where
import GHC.Generics
import qualified Data.ByteString as BS
import Data.Word
import Data... | jqpeterson/roc-translator | src/Protocol/ROC/PointTypes/PointType89.hs | bsd-3-clause | 2,368 | 0 | 9 | 805 | 288 | 161 | 127 | 55 | 1 |
module Text.Highlighter.Lexers.PythonTraceback (lexer) where
import qualified Text.Highlighter.Lexers.Python as Python
import Text.Regex.PCRE.Light
import Text.Highlighter.Types
lexer :: Lexer
lexer = Lexer
{ lName = "Python Traceback"
, lAliases = ["pytb"]
, lExtensions = [".pytb"]
, lMimetypes = ["te... | chemist/highlighter | src/Text/Highlighter/Lexers/PythonTraceback.hs | bsd-3-clause | 1,717 | 0 | 12 | 277 | 536 | 295 | 241 | 25 | 1 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NamedFieldPuns #-}
module Keys where
import Prelude hiding (fail, readFile)
import GHC.Generics
import Data.Aeson (ToJSON)
import qualified Data.ByteString.Lazy.Char8 as BSL
import Control.Monad (replicateM)
import System.IO.Strict (readFile)
import System.Random (randomRIO... | shmookey/pure | app/Keys.hs | bsd-3-clause | 2,463 | 0 | 10 | 537 | 804 | 445 | 359 | 67 | 2 |
module Data.Concurrent.Queue.Roq.Util
(
generate_key
, retry_dirty_write
, retry_dirty_read
)
where
import Prelude -- hiding (catch)
import Control.Distributed.Process hiding (call)
import Data.Concurrent.Queue.Roq.Hroq
import Data.Concurrent.Queue.Roq.Mnesia
-- import Data.Time.Clock
import Data.Thyme.... | alanz/hroq | src/Data/Concurrent/Queue/Roq/Util.hs | bsd-3-clause | 2,653 | 0 | 10 | 514 | 174 | 101 | 73 | 20 | 1 |
{-# LANGUAGE ParallelListComp #-}
-- 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... | UBMLtonGroup/timberc | src/Prepare4C.hs | bsd-3-clause | 28,152 | 3 | 19 | 11,839 | 9,959 | 5,065 | 4,894 | 360 | 8 |
{-# LANGUAGE OverloadedStrings #-}
module TestConfig where
import Data.Map
import Data.Maybe
import Data.OpenSRS.Types
import Data.Time
-- | Testing contacts
testContacts :: Map String Contact
testContacts = fromList [("owner", testc),
("admin", testc),
("billing", t... | anchor/haskell-opensrs | tests/TestConfig.hs | bsd-3-clause | 1,261 | 0 | 9 | 454 | 279 | 155 | 124 | 32 | 1 |
-- | This module defines commonly useful functions that are related specifically with vectors and matrices.
module FPNLA.Matrix.Utils where
import FPNLA.Matrix (Matrix(..))
import Debug.Trace (trace)
-- | Prints a matrix to the standard output.
-- This operation requires the elements of the matrix to have an instan... | mauroblanco/fpnla | src/FPNLA/Matrix/Utils.hs | bsd-3-clause | 737 | 0 | 12 | 205 | 223 | 113 | 110 | 10 | 1 |
{-# LANGUAGE DeriveGeneric, GeneralizedNewtypeDeriving #-}
-- | Actors perceiving other actors and the dungeon level.
--
-- Visibility works according to KISS. Everything that player sees is real.
-- There are no unmarked hidden tiles and only solid tiles can be marked,
-- so there are no invisible walls and to pass th... | LambdaHack/LambdaHack | engine-src/Game/LambdaHack/Common/Perception.hs | bsd-3-clause | 3,230 | 0 | 9 | 654 | 519 | 310 | 209 | 51 | 1 |
{-# LANGUAGE FlexibleContexts, RankNTypes #-}
module Cloud.AWS.EC2.SecurityGroup
( describeSecurityGroups
, createSecurityGroup
, deleteSecurityGroup
, authorizeSecurityGroupIngress
, authorizeSecurityGroupEgress
, revokeSecurityGroupIngress
, revokeSecurityGroupEgress
) where
import D... | worksap-ate/aws-sdk | Cloud/AWS/EC2/SecurityGroup.hs | bsd-3-clause | 4,743 | 0 | 19 | 1,074 | 1,098 | 588 | 510 | 130 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Data.Promotion.Prelude.Eq
-- Copyright : (C) 2014 Jan Stolarek
-- License : BSD-style (see LICENSE)
-- Maintainer : Jan Stolarek (jan.stolarek@p.lodz.pl)
-- Stability : experimental
-- Portability : non-po... | int-index/singletons | src/Data/Promotion/Prelude/Eq.hs | bsd-3-clause | 657 | 0 | 5 | 89 | 67 | 54 | 13 | 4 | 0 |
module Main where
import Graphics.ChalkBoard
import Control.Applicative
example1 :: Point -> Point -> R -> Active (Board Bool)
example1 s e th = id
$ fmap (\ (a,b) -> straightLine (s,(a,b)) th)
$ scale 1
$ actLerp age s e
example2 :: O RGB -> Active (Board RGB)
example2 rgb
= fmap (scale 0.2)
$ fmap (choos... | andygill/chalkboard2 | tests/anim1/Main.hs | bsd-3-clause | 1,131 | 9 | 17 | 266 | 533 | 277 | 256 | 29 | 2 |
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE TemplateHaskell #-}
module Main
where
-- Where a declaration starts with "prop_smoketest_" and has no type sig, it is
-- a Bool that needs to be checked; otherwise we just care that things in here
-- typecheck... | jberryman/shapely-data | test/Main.hs | bsd-3-clause | 18,518 | 0 | 24 | 3,930 | 5,235 | 2,966 | 2,269 | 210 | 3 |
module Language.Deb where
data Expr =
VarE Int
| LamE Expr
| AppE Expr Expr
| LetE Expr Expr
instance Show Expr where
show e =
case e of
VarE n -> show n
LamE e -> "lam(." ++ show e ++ ")"
AppE e1 e2 -> "app(" ++ show e1 ++ "; " ++ show e2 ++ ")"
LetE e e' -> "let(" ++ show e ++ ... | lambdageek/small | src/Language/Deb.hs | bsd-3-clause | 344 | 0 | 13 | 115 | 152 | 74 | 78 | 13 | 0 |
{-# LANGUAGE GADTs #-}
-- |
-- Module : Data.StableTree.Properties
-- Copyright : Jeremy Groven
-- License : BSD3
--
-- Various functions for getting interested data about 'StableTree's and
-- 'Tree's.
module Data.StableTree.Properties
( getKey
, completeKey
, size
, lookup
, keys
, elems
, assocs
, treeContents
,... | tsuraan/stable-tree | src/Data/StableTree/Properties.hs | bsd-3-clause | 9,851 | 0 | 16 | 2,994 | 3,585 | 1,857 | 1,728 | 203 | 9 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE PostfixOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-or... | GaloisInc/tower-camkes-odroid | test/SerialTest.hs | bsd-3-clause | 2,741 | 0 | 26 | 578 | 585 | 294 | 291 | 61 | 1 |
module PackageDBsSpec (main, spec) where
import Prelude ()
import Prelude.Compat
import qualified Control.Exception as E
import Data.List (intercalate)
import PackageDBs
import System.Directory (getCurrentDirectory, setCurrentDirectory... | ekmett/doctest | test/PackageDBsSpec.hs | mit | 2,873 | 0 | 16 | 681 | 763 | 385 | 378 | 61 | 1 |
module B1.Graphics.Rendering.OpenGL.Shapes
( opaqueBubble
) where
import Graphics.Rendering.OpenGL
import B1.Graphics.Rendering.OpenGL.Utils
opaqueBubble :: GLfloat -> GLfloat -> GLfloat
-> Color4 GLfloat -> Color4 GLfloat -> IO ()
opaqueBubble width height padding fillColor borderColor = do
blend $= Disab... | madjestic/b1 | src/B1/Graphics/Rendering/OpenGL/Shapes.hs | bsd-3-clause | 1,211 | 0 | 11 | 240 | 379 | 189 | 190 | 30 | 1 |
{-# LANGUAGE DefaultSignatures, FlexibleInstances, FlexibleContexts #-}
------------------------------------------------------------------------------
-- |
-- Module: Database.PostgreSQL.Simple.ToRow
-- Copyright: (c) 2011 MailRank, Inc.
-- (c) 2011-2012 Leon P Smith
-- License: BSD3
-- Maintain... | timmytofu/postgresql-simple | src/Database/PostgreSQL/Simple/ToRow.hs | bsd-3-clause | 3,902 | 0 | 11 | 876 | 1,632 | 905 | 727 | -1 | -1 |
-- A simple push button calcualtor without operator precedence
module CalcModel (
Number,
Calc,
BinOp, plus, minus, times, divide,
clearCalc, enterDigit, enterDecimalPoint, enterBinOp, evaluate
) where
import Data.Char (isDigit)
import Control.Monad (when)
import Numeric (showGFloat)
-- we could ch... | keithodulaigh/Hets | glade-0.12.5.0/demo/calc/CalcModel.hs | gpl-2.0 | 4,832 | 0 | 21 | 1,848 | 1,343 | 713 | 630 | 121 | 10 |
-- Copyright 2016 TensorFlow authors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agree... | judah/tensorflow-haskell | tensorflow-ops/tests/QueueTest.hs | apache-2.0 | 3,114 | 0 | 17 | 743 | 725 | 387 | 338 | 55 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# OPTIONS_HADDOCK show-extensions #-}
-- |
-- Module : Yi.Buffer.TextUnit
-- License : GPL-2
-- Maintainer : yi-devel@googlegroups.com
-- Stability : experimental
-- Portability : portable
--
-- Working with blocks (units) of text.
--
module Yi.Buffer.TextUnit
... | TOSPIO/yi | src/library/Yi/Buffer/TextUnit.hs | gpl-2.0 | 17,359 | 0 | 16 | 3,836 | 4,195 | 2,200 | 1,995 | 279 | 5 |
module Fun00006 where
import Prelude hiding ((++), (.))
rev :: [a] -> [a]
rev xs = go [] xs
where go acc [] = acc
go acc (x:xs) = go (x:acc) xs
(++) :: [a] -> [a] -> [a]
[] ++ ys = ys
(x:xs) ++ ys = x:(xs ++ ys)
(+++) = (++)
(f . g) x = f (g x)
infixr 5 ++
infix 7 :+
infixl 9 +++
infix 3 . | charleso/intellij-haskforce | tests/gold/parser/Fun00006.hs | apache-2.0 | 318 | 2 | 10 | 101 | 211 | 120 | 91 | 15 | 2 |
{-# OPTIONS_HADDOCK hide #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.PixelRectangles.Reset
-- Copyright : (c) Sven Panne 2002-2013
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability ... | hesiod/OpenGL | src/Graphics/Rendering/OpenGL/GL/PixelRectangles/Reset.hs | bsd-3-clause | 920 | 0 | 7 | 126 | 104 | 70 | 34 | 11 | 1 |
module Graphics.UI.Gtk.Layout.MaybeWidget where
import Control.Monad
import Data.IORef
import Graphics.UI.Gtk
import System.Glib.Types
data MaybeWidget a = MaybeWidget Notebook a Label (IORef MaybeWidgetParams)
type MaybeWidgetParams = Bool
instance WidgetClass (MaybeWidget a)
instance ObjectClass (MaybeWidget a... | keera-studios/gtk-helpers | gtk3/src/Graphics/UI/Gtk/Layout/MaybeWidget.hs | bsd-3-clause | 1,741 | 0 | 15 | 408 | 557 | 273 | 284 | 37 | 2 |
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE GADTs #-}
module SAKS_Fail011 where
import Data.Kind (Type)
type G :: Type -> Type
data G where
MkG :: a -> G a
| sdiehl/ghc | testsuite/tests/saks/should_fail/saks_fail011.hs | bsd-3-clause | 172 | 0 | 7 | 34 | 42 | 26 | 16 | -1 | -1 |
<?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="sr-SP">
<title>SVN Digger Files</title>
<maps>
<homeID>svndigger</homeID>
<mapref locat... | kingthorin/zap-extensions | addOns/svndigger/src/main/javahelp/help_sr_SP/helpset_sr_SP.hs | apache-2.0 | 967 | 77 | 66 | 157 | 409 | 207 | 202 | -1 | -1 |
module ShowUser where
import qualified Github.Users as Github
import Data.Maybe (fromMaybe)
main = do
possibleUser <- Github.userInfoFor "mike-burns"
putStrLn $ either (("Error: "++) . show) formatUser possibleUser
formatUser user@(Github.DetailedOrganization {}) =
"Organization: " ++ (formatName userName logi... | bitemyapp/github | samples/Users/ShowUser.hs | bsd-3-clause | 1,962 | 0 | 25 | 368 | 599 | 306 | 293 | 43 | 1 |
module Literals where
str :: String
str = "str literal"
num :: Num a => a
num = 0 + 1 + 1010011 * 41231 + 12131
frac :: Fractional a => a
frac = 42.0000001
list :: [[[[a]]]]
list = [[], [[]], [[[]]]]
pair :: ((), ((), (), ()), ())
pair = ((), ((), (), ()), ())
| sdiehl/ghc | testsuite/tests/hiefile/should_compile/hie005.hs | bsd-3-clause | 267 | 0 | 8 | 64 | 176 | 104 | 72 | 11 | 1 |
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
module Shape.Description.AABB where
import Shape.Description
import Control.Lens
import Data.Semigroup
import Linear
import Linear.Affine
data AABB a = AABB
{ _aabbCenter :: Point V2 a
, _aabbSize :: V2 a
} deriv... | edwardwas/shape-descr | src/lib/Shape/Description/AABB.hs | isc | 2,270 | 0 | 13 | 601 | 1,027 | 533 | 494 | -1 | -1 |
module Main where
import MyLib
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck as QC
import Test.Tasty.SmallCheck as SC
main :: IO ()
main = defaultMain tests
tests :: TestTree
tests = testGroup "Tests" [properties, unitTests]
properties :: TestTree
properties = testGroup "Properties" [scProp... | genos/Programming | workbench/tasty-example/test/Test.hs | mit | 1,314 | 0 | 12 | 316 | 458 | 253 | 205 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Yesod.Transloadit.OrderedJSON (
encode,
is,
obj,
str
) where
import Data.Monoid (mconcat)
import Data.Text
type KeyValue = (Text, OrderedValue)
data OrderedValue = Object [KeyValue] | String Text deriving (Eq, Show)
quote :: Text
quote... | bobjflong/yesod-transloadit | src/Yesod/Transloadit/OrderedJSON.hs | mit | 834 | 0 | 8 | 184 | 296 | 171 | 125 | 31 | 1 |
module Regen where
import Control.Monad
import Data.List
import Data.Either
import Data.Foldable as F
import CharSet
import Seq
type TSeq = RSeq RAlt
data RAlt = RAlt CharSet [TSeq] deriving (Eq)
data Expr = Seq TSeq | Alt RAlt deriving (Eq)
-- partitionx :: Eq a => ([b] -> b) -> ([b] -> [b]) -> [[a]] -> [(a, [[a]... | andy128k/regen | Regen.hs | mit | 3,104 | 0 | 15 | 766 | 1,426 | 752 | 674 | 72 | 5 |
module GitHub.Gitignore where
import GitHub.Internal
templates = "/gitignore/templates"
templates t = (templates <> "/" <> t)
--| GET /gitignore/templates
listGitignoreTemplates ::
GitHub GitignoreTemplatesData
listGitignoreTemplates = ghGet templates
--| GET /gitignore/templates/:templatename
getGitignoreTemplate ... | SaneApp/github-api | src/GitHub/Gitignore.hs | mit | 402 | 6 | 9 | 47 | 116 | 60 | 56 | -1 | -1 |
import System.Random
-- ||GOAL:
-- || import qualified RapidlyExploringRandomTree as RRT
-- || f = Dynamics {{Function StatePoint ControlInput}}
-- || system = ControlledSystem f
-- ||
-- || random = {{Make a Random instance}}
-- || RRT.build random 10**3 system
-- | Rapidly-Exploring Random Tree Framework
-- Multip... | Zomega/thesis | Wurm/Trajectory/RRT.hs | mit | 1,960 | 0 | 11 | 450 | 507 | 273 | 234 | -1 | -1 |
-- 1. let x = 5 in x
-- 2. let x = 5 in x * x
-- 3. let x = 5; y = 6 in x * y
-- 4. let x = 3; y = 1000 in x + 3
mult1 = x * y
where x = 5
y = 6
-- (\x -> x) 0
-- (\x -> x) 1
-- (\x -> x) "blah"
-- let id = \x -> x
-- id 0
-- id 1
-- let id x = x
-- id 0
-- id 1
-- let a = b in c
-- (\a -> c) b
-- let x... | diminishedprime/.org | reading-list/haskell_programming_from_first_principles/02_12.hs | mit | 584 | 0 | 6 | 226 | 46 | 36 | 10 | 3 | 1 |
-- Haskell homework for our Programming Languages Class
-- 1139626 José Alberto Esquivel
-- 1195815 Eduardo Sánchez
--1. Implementar la función recursiva distintos que liste los elementos distintos
--que pertenecen a dos listas. Asumir que los elementos no se repiten dentro de la
--misma lista.
contiene :: (Eq a) => ... | betoesquivel/haskell | 1139626_1195815_Tarea6.hs | mit | 3,886 | 0 | 11 | 920 | 1,280 | 673 | 607 | 61 | 2 |
module AI
where
import Types
import Util
mapFigure :: Figure -> (Int, Int) -> Field -> Field
mapFigure (block, r) (x, y) field = start
where
blockM = blockMatrix block
blockL = length blockM
figure = (apply r rotateCW) blockM
start
| y < 0 = loop (drop (-y) figure) field
| oth... | artems/blockbattle | src/AI.hs | mit | 1,687 | 0 | 12 | 510 | 744 | 383 | 361 | 46 | 5 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Various sum types.
--
module Network.AWS.Wolf.Types.Sum where
import Data.Aeson.TH
import Network.AWS.Wolf.Prelude
-- | LabelType
--
-- Tags for referencing workers.
--
data LabelType
= LabelWolf
| LabelAct
| LabelDecide
deriving (Sho... | mfine/wolf | src/Network/AWS/Wolf/Types/Sum.hs | mit | 368 | 0 | 8 | 59 | 68 | 44 | 24 | 11 | 0 |
{-|
Module : PostgREST.Auth
Description : PostgREST authorization functions.
This module provides functions to deal with the JWT authorization (http://jwt.io).
It also can be used to define other authorization functions,
in the future Oauth, LDAP and similar integrations can be coded here.
Authentication should ... | steve-chavez/postgrest | src/PostgREST/Auth.hs | mit | 2,987 | 0 | 12 | 656 | 666 | 355 | 311 | 49 | 5 |
{-# LANGUAGE TemplateHaskell, MultiParamTypeClasses, FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances, FunctionalDependencies, ConstraintKinds #-}
{-# LANGUAGE RankNTypes #-}
module Chimera.Engine.Core.Util (
boxVertex, boxVertexRotated
, cutIntoN
, rot2M, rotate2
, insertIM, insertIM', insertsIM'
, (<... | myuon/Chimera | Chimera/Engine/Core/Util.hs | mit | 1,580 | 0 | 11 | 375 | 730 | 390 | 340 | 41 | 1 |
module Feature.NonexistentSchemaSpec where
import Network.Wai (Application)
import Test.Hspec
import Test.Hspec.Wai
import Protolude hiding (get)
spec :: SpecWith ((), Application)
spec =
describe "Non existent api schema" $ do
it "succeeds when requesting root path" $
get "/" `shouldRespondWith` 200
... | steve-chavez/postgrest | test/Feature/NonexistentSchemaSpec.hs | mit | 458 | 0 | 10 | 83 | 102 | 56 | 46 | 12 | 1 |
module Unused.LikelihoodCalculator
( calculateLikelihood
, LanguageConfiguration
) where
import qualified Data.List as L
import qualified Data.Maybe as M
import qualified Unused.ResponseFilter as RF
import Unused.ResultsClassifier (LanguageConfiguration(..), LowLikelihoodMatch(..))
import ... | joshuaclayton/unused | src/Unused/LikelihoodCalculator.hs | mit | 1,929 | 0 | 11 | 345 | 459 | 258 | 201 | 33 | 1 |
import Control.Monad
f n arr = -- Complete this Function
join $ map (take n . repeat) arr
-- This part handles the Input and Output and can be used as it is. Do not modify this part.
main = do
n <- readLn :: IO Int
inputdata <- getContents
mapM_ putStrLn $ map show $ f n $ map (read :: String -> Int) $ li... | jerryzh168/hackerrank | FunctionalProgramming/Introduction/ListReplications.hs | mit | 333 | 0 | 11 | 81 | 106 | 51 | 55 | 7 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module ZoomHub.Web.Errors
( error400,
error401,
error404,
error503,
)
where
import qualified Data.ByteString.Lazy.UTF8 as BU
import Servant (ServerError, err400, err401, err404, err503, errBody, errHeaders)
error400 :: String -> ServerError
error400 = mkError err400... | zoomhub/zoomhub | src/ZoomHub/Web/Errors.hs | mit | 704 | 0 | 8 | 125 | 178 | 106 | 72 | 21 | 1 |
module Command.Summary.Calculate (calculateSummary) where
import Data.Either
import Data.List
import Data.Maybe
import Data.Time
import Database.HDBC
import Database.HDBC.Sqlite3
import Text.PrettyPrint.Boxes
import Command.Summary.Types
import Currency
import Settings
import Util
-- amount, frequency, start
data Ti... | jpotterm/manila-hs | src/Command/Summary/Calculate.hs | cc0-1.0 | 4,498 | 0 | 15 | 854 | 1,000 | 506 | 494 | 79 | 3 |
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import qualified SDL
import qualified Common as C
import Control.Monad.Loops (iterateUntilM)
import Data.Foldable (foldl')
data Intent
= Idle
| Quit
| Press Quadrant
| Release Quadrant
| Hover Quadrant
| Leave Quadrant
data World... | palf/haskellSDL2Examples | examples/lesson17/src/Lesson17.hs | gpl-2.0 | 5,348 | 0 | 21 | 1,395 | 2,072 | 1,081 | 991 | 155 | 2 |
module Expressions where
import qualified Data.Map as Map
import Control.Monad.State
import Control.Monad.Error
-- S-expressions
data LispExpr = Blank |
LispInt Integer |
LispSymbol String |
LispLambda LispResult FunctionSignature |
LispSpecial LispResult Fun... | aksiazek/yali | src/Expressions.hs | gpl-2.0 | 2,130 | 26 | 17 | 489 | 680 | 354 | 326 | 37 | 2 |
module Handler.Bug where
import Import
getBugR :: BugId -> Handler Html
getBugR bugId = do
bug <- runDB $ get404 bugId
defaultLayout $ do
setTitle $ toHtml $ bugTitle bug
$(widgetFile "bug")
| juanvallejo/portable-bug-tracker | Handler/Bug.hs | gpl-2.0 | 217 | 0 | 12 | 58 | 74 | 35 | 39 | 8 | 1 |
module Literate where
import Data.Monoid
import Data.DList hiding (foldr, map)
import MarXupParser
import Data.List (isPrefixOf)
import Output
import Config
----------------------------------------------
-- Top-level generation
rHaskells :: [Haskell] -> Doc
rHaskells xs = mconcat $ map rHaskell xs
rHaskell :: Haske... | jyp/MarXup | Literate.hs | gpl-2.0 | 790 | 0 | 10 | 124 | 280 | 147 | 133 | 21 | 1 |
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
-----------------------------------------------------------------------------
--
-- Module : Math.InnerProduct
-- Copyright : Christian Gosch
-- License : BSD3
--
-- Maintainer :
-- Stability :
-- Portability :
--
-- |
--
-----------------... | cgo/jalla | Numeric/Jalla/InnerProduct.hs | gpl-3.0 | 616 | 0 | 8 | 107 | 61 | 42 | 19 | 5 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.