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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
-----------------------------------------------------------------------------
-- Copyright : (c) Hanzhong Xu, Meng Meng 2016,
-- License : MIT License
--
-- Maintainer : hanzh.xu@gmail.com
-- Stability : experimental
-- Portability : portable
---------------------------------------------------------------... | PseudoPower/AFSM | examples/SF/HelloWorld.hs | mit | 3,100 | 0 | 9 | 642 | 786 | 474 | 312 | 34 | 2 |
#!/usr/bin/env stack
-- stack ghci
{-# LANGUAGE LiberalTypeSynonyms #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
module Lens where
import Control.Lens
import Control.Monad.Trans.Class
import Control.Monad.Trans.State
type Lens' a b = forall f . (Functor f... | mortum5/programming | haskell/usefull/Lens.hs | mit | 2,516 | 1 | 19 | 820 | 818 | 448 | 370 | -1 | -1 |
module Settings.Config where
import Prelude
import Language.Haskell.TH.Syntax
import System.Environment (lookupEnv)
import Yesod.Default.Config2 (configSettingsYml)
configPath :: Q FilePath
configPath = do
path <- runIO $ lookupEnv "RH_CONFIG_PATH"
return . maybe configSettingsYml id $ path
| ruHaskell/ruhaskell-yesod | Settings/Config.hs | mit | 315 | 0 | 9 | 56 | 80 | 44 | 36 | 9 | 1 |
{-# LANGUAGE FlexibleInstances #-}
module Ternary.Core.Multiplication (
Triangle, AppliedTriangle, TS,
TriangleState (..),
MultiplicationState (..),
TriangleParam (TriangleParam),
MulState (MulState),
scalar, selfTerms,
initialTS, multKernel, fineStructure) where
import Ternary.Core.Kernel
import Ternar... | jeroennoels/exact-real | src/Ternary/Core/Multiplication.hs | mit | 4,286 | 0 | 11 | 799 | 1,078 | 604 | 474 | 68 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE RankNTypes #-}
-- |
--
-- defines the syntax tree and template parsers the "Commands.TH" module hierarchy uses.
--
module Commands.TH.Syntax where
import Commands.Text.Parsec
import Commands.Grammar
import Data.List.NonEmpty (NonEmpty(..))
import Prelude hiding (head)
i... | sboosali/Haskell-DragonNaturallySpeaking | sources/Commands/TH/Syntax.hs | mit | 3,571 | 0 | 11 | 652 | 495 | 303 | 192 | 41 | 1 |
module Unison.Runtime.Vector where
-- |
-- Fast sequence type based on skewed array-indexed tries
-- with large branching factor, `B`.
--
-- Asymptotics (assuming vector of size `N`):
-- O(1) worst-case access to indices [0,B)
-- O(1) average-case access to indices [N-B,N)
-- O(log_B(i)) worst-case access to ind... | nightscape/platform | node/src/Unison/Runtime/Vector.hs | mit | 3,494 | 0 | 15 | 821 | 1,586 | 801 | 785 | 74 | 4 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-missing-fields #-}
-- | A Shakespearean module for general text processing, introducing type-safe,
-- compile-time variable interpolation.
--
-- Text templates use the same parser as... | yesodweb/shakespeare | Text/Shakespeare/Text.hs | mit | 6,519 | 62 | 18 | 1,320 | 1,382 | 791 | 591 | 137 | 1 |
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE OverloadedStrings #-}
module
Nayoro.Web
( runApp
) where
import Web.Apiary
import Web.Apiary.Database.Persist
import Web.Apiary.Logger
import Network.Wai.Handler.Warp
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Class (lift)
import quali... | liquidamber/nayoro | src/Nayoro/Web.hs | mit | 2,676 | 0 | 20 | 537 | 779 | 411 | 368 | 63 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-userpool-stringattributeconstraints.html
module Stratosphere.ResourceProperties.CognitoUserPoolString... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/CognitoUserPoolStringAttributeConstraints.hs | mit | 2,425 | 0 | 12 | 206 | 265 | 152 | 113 | 27 | 1 |
import qualified Data.Set as S (Set, empty, fromList, insert)
sets :: [Integer] -> [Integer] -> S.Set Integer
sets ps = S.fromList . concatMap (g ps) where
g [] _ = []
g (x:xs) y = (x ^ y) : g xs y
main :: IO ()
main = print . length $ sets [2..100] [2..100]
| tamasgal/haskell_exercises | ProjectEuler/p029_alt.hs | mit | 265 | 0 | 9 | 61 | 157 | 84 | 73 | 7 | 2 |
var food = query_inventory("food");
var tools = query_inventory("tools");
var ore = query_inventory("ore");
var has_food = food >= 1;
var has_tools = tools >= 1;
var has_ore = ore >= 1;
if(has_food && has_ore){
if(has_tools){
//convert all ore into metal, consume 1 food, break tools with 10% chance
produce(a... | larsiusprime/bazaarBot | examples/doran_and_parberry/Assets/scripts/refiner.hs | mit | 777 | 45 | 9 | 131 | 402 | 236 | 166 | -1 | -1 |
module Main where
import Primes (prime')
import Util (truncateRight, digitsToInt)
import Data.List (permutations)
main :: IO ()
main =
let
seeds = takeWhile (/= []) $ iterate tail [7,6..1]
pans = map digitsToInt $ concat $ map permutations seeds
results = filter prime' pans
in
... | liefswanson/projectEuler | app/p1/q41/Main.hs | gpl-2.0 | 343 | 0 | 12 | 90 | 123 | 66 | 57 | 11 | 1 |
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-
Copyright (C) 2008 John MacFarlane <jgm@berkeley.edu>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or... | tphyahoo/gititpt | Network/Gitit/Server.hs | gpl-2.0 | 2,455 | 0 | 13 | 573 | 360 | 195 | 165 | 31 | 3 |
-- |
-- Module : Control.Functor.Constrained
-- Copyright : (c) 2014 Justus Sagemüller
-- License : GPL v3 (see COPYING)
-- Maintainer : (@) jsag $ hvl.no
--
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LA... | leftaroundabout/constrained-categories | Control/Functor/Constrained.hs | gpl-3.0 | 4,313 | 0 | 12 | 1,036 | 1,583 | 848 | 735 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module GridResponse
(gridResponse) where
import qualified Text.Blaze.Html5 as H
import Happstack.Server
import Utilities
import MasterTemplate
import Scripts
gridResponse :: ServerPart Response
gridResponse =
ok $ toResponse $
masterTemplate "Courseography - Grid"
... | arkon/courseography | hs/GridResponse.hs | gpl-3.0 | 1,605 | 0 | 12 | 463 | 316 | 157 | 159 | 42 | 1 |
module Web.SpriteIcons.TH (spritesFromJSON, Octicon, toSVGAtSize, toSVGAtWidth, toSVGAtHeight, toSVG) where
import Data.Aeson
import qualified Data.ByteString.Lazy as BSL
import Data.Char
import qualified Data.Map as Map
import qualified Data.Text as T
import Language.Haskell.TH
import Lucid
data Octicon = Octicon {
... | typedrat/typedrat-site | app/Web/SpriteIcons/TH.hs | gpl-3.0 | 2,351 | 0 | 16 | 593 | 976 | 504 | 472 | -1 | -1 |
module Main where
--- factorial
--- if < 0 then -1 "error"
fac :: Int -> Int
fac a =
if a < 0
then - 1
else
let
stop a = a == 1
go res a = if stop a
then res
else let res' = res * a
a' = a - 1
in go res' a'
in go 1 a
main = print (fac 3)
| nastya13/Factorial | src/Main.hs | gpl-3.0 | 298 | 6 | 15 | 129 | 130 | 67 | 63 | 14 | 3 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
module Grav2ty.Protocol where
import Prelude hiding (take)
import Grav2ty.Core
import Grav2ty.Util.Serialization
import Data.Attoparsec.ByteString
import Data.Bits
import Data.ByteString (ByteString (..))
import qualified Data.ByteString as BS
import Da... | lukasepple/grav1ty | lib/Grav2ty/Protocol.hs | gpl-3.0 | 3,684 | 0 | 16 | 865 | 1,420 | 732 | 688 | 96 | 3 |
{-# LANGUAGE DerivingStrategies #-}
-- |
-- Module : Aura.Settings.External
-- Copyright : (c) Colin Woodbury, 2012 - 2020
-- License : GPL3
-- Maintainer: Colin Woodbury <colin@fosskers.ca>
--
-- A simple parser for .conf files, along with types for aura-specific config
-- files.
module Aura.Settings.External
... | aurapm/aura | aura/lib/Aura/Settings/External.hs | gpl-3.0 | 3,123 | 0 | 16 | 654 | 815 | 443 | 372 | 82 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/ForwardingRules/Delete.hs | mpl-2.0 | 4,821 | 0 | 17 | 1,071 | 552 | 330 | 222 | 87 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/RegionTargetHTTPSProxies/Get.hs | mpl-2.0 | 4,401 | 0 | 16 | 973 | 468 | 280 | 188 | 81 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-mirror/gen/Network/Google/Resource/Mirror/Subscriptions/Insert.hs | mpl-2.0 | 2,793 | 0 | 12 | 621 | 304 | 187 | 117 | 49 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
-- |
-- Module : Network.Google.CloudPrivateCatalog
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : ... | brendanhay/gogol | gogol-cloudprivatecatalog/gen/Network/Google/CloudPrivateCatalog.hs | mpl-2.0 | 5,435 | 0 | 12 | 768 | 427 | 321 | 106 | 81 | 0 |
module Test where
f = Just.let x = id in x
| metaborg/jsglr | org.spoofax.jsglr/tests-offside/terms/doaitse/error8.hs | apache-2.0 | 43 | 1 | 6 | 11 | 22 | 12 | 10 | 2 | 1 |
module Step_2_5 where
import Text.Html
page = thehtml <<
[ header << (thetitle << "Output")
, body <<
[ h1 << "A poem from last time:"
, pre << poemText
, h1 << "A to-do list:"
, thediv << toDoHtml
]
]
-- This time we've rewritten the lineNumbers function using "p... | mzero/barley | seed/Chapter2/Step_2_5.hs | apache-2.0 | 1,836 | 0 | 9 | 414 | 420 | 228 | 192 | 31 | 1 |
{-# language PolyKinds, TypeFamilies, GADTs,
UndecidableInstances, ConstraintKinds,
StandaloneDeriving
#-}
module Language.SIL.Syntax where
import qualified Data.Coerce
import Names
import Language.Common.Label
import Language.CoreLang
class (CoreLang lang, Monad m) => MapNameMonad m lan... | lambdageek/emile | src/Language/SIL/Syntax.hs | bsd-2-clause | 7,579 | 8 | 14 | 1,674 | 2,270 | 1,197 | 1,073 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-|
A representation of binary relations as pairs of left-image and
right-image functions. -}
module BRC.BinRel where
import BRC.SetOf (SetOf)
data (SetOf e s) => BinRel e s =
BinRel {
contains :: e -> e -> Bool,
-- ^ A simple membership test. This must be consiste... | kcharter/brc-solver | BRC/BinRel.hs | bsd-2-clause | 765 | 0 | 10 | 203 | 82 | 53 | 29 | 8 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-| Implementation of the Ganeti maintenenace server.
-}
{-
Copyright (C) 2015 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 so... | leshchevds/ganeti | src/Ganeti/MaintD/Server.hs | bsd-2-clause | 7,716 | 0 | 19 | 1,546 | 1,754 | 928 | 826 | 134 | 2 |
{-# LANGUAGE TupleSections, OverloadedStrings #-}
module Handler.Home where
import Import
import System.Random (getStdRandom, randomR, StdGen)
import qualified Data.Text as T
import Data.Text.Encoding (encodeUtf8, decodeUtf8)
import Control.Monad (replicateM)
import Control.Monad.Trans.State
import Data.Time (getCurre... | snoyberg/whosawthatcoming | Handler/Home.hs | bsd-2-clause | 4,377 | 0 | 18 | 1,362 | 1,153 | 584 | 569 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Application.YesodCRUD.Client.Job where
import Debug.Trace
import qualified Data.ByteString.Lazy.Char8 as C
import qualified Data.ByteString.Char8 as SC
import Data.Aeson.Types
import Data.Aeson.Encode as E
import Data.Aeson.Parser
import qualified Data.Attoparsec as A
impor... | wavewave/yesodcrud-client | lib/Application/YesodCRUD/Client/Job.hs | bsd-2-clause | 4,055 | 0 | 19 | 879 | 1,239 | 629 | 610 | 98 | 2 |
module Clues
( Clues()
, isValidClues
, clues
, unClues
, clueAt
, updateClueAt
) where
import Data.Array (Array, bounds, (!), (//))
import Axis (Axis)
import Clue (Clue)
data Clues = Clues (Array Axis Clue)
deriving (Eq, Ord, Show)
-- Checks whether the given Clues are valid.
isValidClues :: Clues ... | jameshales/voltorb-flip | src/Clues.hs | bsd-3-clause | 948 | 0 | 9 | 222 | 301 | 165 | 136 | -1 | -1 |
module Data.Char.Properties.Case
(
module Data.Char.Properties.CaseData
) where
{
import Data.Char.Properties.CaseData;
}
| seereason/unicode-properties | Data/Char/Properties/Case.hs | bsd-3-clause | 138 | 0 | 5 | 27 | 28 | 21 | 7 | 4 | 0 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Constants used throughout the project.
module Stack.Constants
(buildPlanDir
,haskellModuleExts
,stackDotYaml
,stackWorkEnvVar
,stackRootEnvVar
,stackRootOptionName
,deprecatedStackRo... | MichielDerhaeg/stack | src/Stack/Constants.hs | bsd-3-clause | 7,452 | 0 | 8 | 1,466 | 914 | 550 | 364 | 150 | 1 |
module WASHGenerator (preprocess, preprocessPIPE) where {
import Control.Exception;
import Data.List (isPrefixOf);
import System.IO;
import WASHData ;
import Text.ParserCombinators.Parsec hiding (try) ;
import qualified WASHParser ;
import qualified WASHExpression ;
import qualified WASHClean ;
import WASHFlags ;
--... | nh2/WashNGo | washparser/hs/WASHGenerator.hs | bsd-3-clause | 1,717 | 6 | 13 | 339 | 552 | 307 | 245 | 42 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Heed.Vty.MainWidget
( app
, insertInOrder
, MyEvent(WsReceive)
) where
import qualified Brick.AttrMap as BA
import qualified Brick.Main as M
import Brick.Types (Widget)
import qualified Brick.Types as BT
import qualified Brick.Util as BU
import qualified Brick... | Arguggi/heed | heed-vty/src/Heed/Vty/MainWidget.hs | bsd-3-clause | 10,354 | 0 | 19 | 2,462 | 3,813 | 1,958 | 1,855 | -1 | -1 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.UserHooks
-- Copyright : Isaac Jones 2003-2005
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This defines the API that @Setup.hs@ scripts can use to customise the w... | dcreager/cabal | Distribution/Simple/UserHooks.hs | bsd-3-clause | 10,469 | 0 | 14 | 2,238 | 1,367 | 795 | 572 | 97 | 1 |
-- | 'query' variants returning 'V.Vector'.
module Database.PostgreSQL.Simple.Vector where
import Database.PostgreSQL.Simple (Connection, formatQuery, formatMany)
import Database.PostgreSQL.Simple.FromRow (FromRow(..))
import Database.PostgreSQL.Simple.ToRow (ToRow(..))
import D... | tomjaguarpaw/postgresql-simple | src/Database/PostgreSQL/Simple/Vector.hs | bsd-3-clause | 2,043 | 0 | 13 | 379 | 540 | 289 | 251 | 27 | 1 |
{-# LANGUAGE DoRec #-}
module Main where
import Language.Java.Syntax
import Language.Java.Pretty
import Language.Java.ClassFile
import Data.Binary.Get
import qualified Data.ByteString.Lazy as BL
import Control.Applicative
import Control.Monad (replicateM, forM, forM_, mapM, mapM_)
import Data.Maybe (mapMaybe)
import... | gergoerdi/language-java-classfile | Main.hs | bsd-3-clause | 1,526 | 0 | 17 | 335 | 338 | 179 | 159 | 34 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE UnicodeSyntax #-}
{-|
[@ISO639-1@] -
[@ISO639-2@] -
[@ISO639-3@] coo
[@Native name@] -
[@English name@] Comox
-}
module Text.Numeral.Language.COO.TestData (cardinals... | telser/numerals | src-test/Text/Numeral/Language/COO/TestData.hs | bsd-3-clause | 5,323 | 0 | 8 | 1,271 | 994 | 665 | 329 | 112 | 1 |
{-# OPTIONS_GHC -fno-warn-tabs #-}
import AES
import Common
import Hex
import Data.List
import System.IO
main = do
putStrLn "=== Challange8 ==="
handle <- openFile "8.txt" ReadMode
encs <- fmap (map hexDecode . lines) $ hGetContents handle
putStr "ECB encrypted string detected: #"
putStrLn $ show $ fst $ last $... | andrewcchen/matasano-cryptopals-solutions | set1/Challange8.hs | bsd-3-clause | 440 | 0 | 13 | 86 | 158 | 76 | 82 | 13 | 1 |
module RandomExample2 where
import Control.Applicative (liftA3)
import Control.Monad (replicateM)
import Control.Monad.Trans.State
import System.Random
data Die = DieOne
| DieTwo
| DieThree
| DieFour
| DieFive
| DieSix
deriving (Eq, Enum, Show)
intToDie :: Int ->... | chengzh2008/hpffp | src/ch23-State/RandomExample2.hs | bsd-3-clause | 1,719 | 0 | 12 | 400 | 632 | 339 | 293 | 44 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE ScopedTypeVariables #-}
------------------------------------------------------------------------------
-- |
-- Module : Semantics
-- Copyright : (c) Greg Hale 2016
-- License : BSD3 (see the file LICENSE)
--
-- Maintai... | CBMM/CBaaS | cbaas-lib/src/Semantics.hs | bsd-3-clause | 1,518 | 0 | 8 | 260 | 184 | 118 | 66 | 26 | 1 |
-- |
-- Module : Network.TLS.Handshake.Certificate
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : experimental
-- Portability : unknown
--
module Network.TLS.Handshake.Certificate
( certificateRejected
, rejectOnException
) where
import Network.TLS.Con... | erikd/hs-tls | core/Network/TLS/Handshake/Certificate.hs | bsd-3-clause | 1,286 | 0 | 8 | 174 | 220 | 126 | 94 | 19 | 1 |
#if __GLASGOW_HASKELL__ >= 701
{-# LANGUAGE Trustworthy #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Win32.Types
-- Copyright : (c) Alastair Reid, 1997-2003
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : ... | DavidAlphaFox/ghc | libraries/Win32/System/Win32/Types.hs | bsd-3-clause | 9,483 | 37 | 13 | 1,872 | 2,134 | 1,174 | 960 | -1 | -1 |
module Parsers.ColorSpec where
import Test.Hspec
import Text.Parsec (parse)
import Types.Color
import Parsers.Color
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "Color Parsers" $ do
it "Hexadecimal (3 digit)" $
parse hexColor "" "#333 ignore" `shouldBe` Right (Color 51 51 51 1)
it "Hexade... | cimmanon/classi | test/Parsers/ColorSpec.hs | bsd-3-clause | 1,099 | 18 | 13 | 238 | 429 | 209 | 220 | 28 | 1 |
module Partly.Make where
-- base:
import Data.List (tails)
import Data.Char (toLower)
import Data.Word (Word16)
import Control.Applicative
-- bytestring:
import qualified Data.ByteString as B
-- optparse-applicative:
import Options.Applicative
-- partly:
import System.Disk.Partitions.MBR
import Partly.Json
import Partl... | startling/partly | Partly/Make.hs | bsd-3-clause | 2,231 | 0 | 16 | 528 | 671 | 353 | 318 | 59 | 6 |
module Data.Char.SScriptSpec where
import Data.Char.SScript
import Control.Monad (ap)
import Test.Hspec
-- A fixed point is a value that doesn't change under application of a function
shouldBeFixed :: (Eq a, Show a) => (a -> a) -> a -> Expectation
shouldBeFixed = ap shouldBe
convertDecimals :: (Char -> Char) -> Str... | khalilfazal/sscript | test/Data/Char/SScriptSpec.hs | bsd-3-clause | 2,632 | 0 | 13 | 674 | 427 | 211 | 216 | 49 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Views.DomainPrivileges (domainPrivilegesT) where
import Data.Text.Lazy (Text)
import Data.Monoid
import Text.Blaze.Html5 hiding (p)
import qualified Text.Blaze.Html5 as H
import Text.Blaze.Html5.Attributes
import qualified Text.Blaze.H... | alpmestan/spw | src/Views/DomainPrivileges.hs | bsd-3-clause | 4,558 | 0 | 37 | 2,193 | 1,043 | 482 | 561 | 87 | 1 |
-- Copyright: Xavier Lange, 2011
-- License: BSD
module ZMQHS.Message
(
getMessage,
parseIdentity,
buildIdentityMessage,
buildMessage,
Identity(..),
Message(..)
)
where
import ZMQHS.Frame
import qualified Data.Attoparsec as AP
import qualified Data.ByteString as BS
import qualified Blaze.ByteS... | xrl/zmqhs | ZMQHS/Message.hs | bsd-3-clause | 1,709 | 0 | 11 | 304 | 498 | 275 | 223 | 46 | 2 |
{-# LANGUAGE RankNTypes #-}
module THilbert where
import Control.Monad (replicateM)
import Control.Applicative (liftA, liftA3, (<$>))
import Data.Algorithm.Hilbert.Functions
import Data.Algorithm.Hilbert.Types
import Data.Algorithm.Hilbert.Utility
import Data.Bits
import Data.List (sort)
import Data.Maybe
imp... | cje/hilbert | test/THilbert.hs | bsd-3-clause | 41,962 | 0 | 21 | 15,631 | 11,572 | 6,393 | 5,179 | -1 | -1 |
module System.Console.Haskeline.Monads(
module System.Console.Haskeline.MonadException,
MonadTrans(..),
MonadIO(..),
ReaderT,
runReaderT,
runReaderT',
mapReaderT,
asks,
StateT,... | DavidAlphaFox/ghc | libraries/haskeline/System/Console/Haskeline/Monads.hs | bsd-3-clause | 4,155 | 0 | 14 | 1,368 | 1,692 | 885 | 807 | -1 | -1 |
{-# LANGUAGE CPP #-}
{-|
IP routing table is a tree of 'AddrRange'
to search one of them on the longest
match base. It is a kind of TRIE with one
way branching removed. Both IPv4 and IPv6
are supported.
-}
module Data.IP.RouteTable.Internal where
#if __GLASGOW_HASKELL__ < 709
import Control.Applicative ((<$... | DanielG/iproute | Data/IP/RouteTable/Internal.hs | bsd-3-clause | 8,782 | 0 | 12 | 2,119 | 2,672 | 1,365 | 1,307 | -1 | -1 |
module ResultWorthy.DataTypes where
import Data.Maybe
import Data.Traversable
import Control.Applicative
data SwiftContainerType = SwiftStruct
| SwiftClass
{ ctFinal :: Bool }
| SwiftExtension
deriving (Eq, Show, Read)
data InitializerMod... | lawrencelomax/ResultWorthy | ResultWorthy/DataTypes.hs | bsd-3-clause | 3,196 | 0 | 9 | 1,264 | 655 | 399 | 256 | 80 | 0 |
{-# LANGUAGE FlexibleContexts #-}
-- | Description : The main module that starts the server.
module Guide.Main
(
-- * Main
main,
-- * All supported commands
runServer,
dryRun,
loadPublic,
apiDocs,
)
where
import Imports
-- Concurrent
import Control.Concurrent.Async
-- Monads and monad transformers... | aelve/guide | back/src/Guide/Main.hs | bsd-3-clause | 14,628 | 0 | 23 | 3,316 | 2,942 | 1,474 | 1,468 | -1 | -1 |
-- | This module provides a program step. A step can be an evaluation, a
-- refinement or an abstraction.
module Jat.PState.Step
(
Step (..)
, PStep
, evaluation
, topEvaluation
, topRefinement
, liftStep
, liftPStep
)
where
import Jat.Constraints (PATerm,top)
-- | The type of a step.
data Step ... | ComputationWithBoundedResources/jat | src/Jat/PState/Step.hs | bsd-3-clause | 1,289 | 0 | 9 | 296 | 451 | 249 | 202 | 30 | 1 |
module PFDS.Sec9.SparseByWeight where
type Nat = [Int]
carry :: Int -> Nat -> Nat
carry w [] = [w]
carry w ws@(w' : ws') =
if w < w' then w : ws else carry (2 * w) ws'
borrow :: Int -> Nat -> Nat
borrow w [] = [w]
borrow w ws@(w' : ws') =
if w == w' then ws' else w : borrow (2 * w) ws
inc :: Nat -... | matonix/pfds | src/PFDS/Sec9/SparseByWeight.hs | bsd-3-clause | 588 | 0 | 9 | 190 | 349 | 183 | 166 | 21 | 2 |
-----------------------------------------------------------------------------
-- |
-- Module : System.Taffybar.Widget.XDGMenu.Menu
-- Copyright : 2017 Ulf Jasper
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : Ulf Jasper <ulf.jasper@web.de>
-- Stability : unstable
-- Portability : unportable
--
-... | teleshoes/taffybar | src/System/Taffybar/Widget/XDGMenu/Menu.hs | bsd-3-clause | 4,644 | 0 | 19 | 1,276 | 1,172 | 636 | 536 | 98 | 3 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
#define HINT
#include "../Server.hs"
| janrain/snap | src/Snap/Extension/Server/Hint.hs | bsd-3-clause | 126 | 0 | 2 | 16 | 7 | 6 | 1 | 3 | 0 |
{-# language QuasiQuotes #-}
{-# language TemplateHaskell #-}
module ExampleExtractor ( render, extractExampleImages ) where
import "base" Control.Arrow
import "base" Control.Monad
import "base" Data.Either
import "base" Data.Maybe
import "base" Data.Monoid
import qualified "containers" Data.Map.Strict as M
import "d... | lukexi/haskell-opencv | doc/ExampleExtractor.hs | bsd-3-clause | 9,060 | 0 | 20 | 2,489 | 2,403 | 1,295 | 1,108 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TemplateHaskell #-}
module Ros.Geometry_msgs.InertiaStamped where
import qualified Prelude as P
import Prelude ((.), (+), (*))
import qualified Data.Typeable as T
import Control.Applicative
import Ros.Inte... | acowley/roshask | msgs/Geometry_msgs/Ros/Geometry_msgs/InertiaStamped.hs | bsd-3-clause | 1,463 | 1 | 9 | 263 | 364 | 215 | 149 | 35 | 0 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Dependency.Types
-- Copyright : (c) Duncan Coutts 2008
-- License : BSD-like
--
-- Maintainer : cabal-devel@haskell.org
-- Stability : ... | randen/cabal | cabal-install/Distribution/Client/Dependency/Types.hs | bsd-3-clause | 11,429 | 0 | 13 | 2,302 | 1,602 | 923 | 679 | 165 | 3 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Get
-- Copyright : (c) Andrea Vezzosi 2008
-- Duncan Coutts 2011
-- John Millikin 2012
-- License : BSD-like
--
-- Maintainer : ca... | thomie/cabal | cabal-install/Distribution/Client/Get.hs | bsd-3-clause | 12,868 | 0 | 22 | 3,422 | 2,996 | 1,534 | 1,462 | 254 | 6 |
{-# LANGUAGE CPP #-}
--
-- (c) The GRASP/AQUA Project, Glasgow University, 1993-1998
--
--------------------------------------------------------------
-- Converting Core to STG Syntax
--------------------------------------------------------------
-- And, as we have the info in hand, we may convert some lets to
-- le... | AlexanderPankiv/ghc | compiler/stgSyn/CoreToStg.hs | bsd-3-clause | 46,841 | 0 | 21 | 14,193 | 7,749 | 4,220 | 3,529 | -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>Requester</title>
<maps>
<homeID>requester</homeID>
<mapref location="ma... | kingthorin/zap-extensions | addOns/requester/src/main/javahelp/help_sr_SP/helpset_sr_SP.hs | apache-2.0 | 960 | 77 | 66 | 155 | 404 | 205 | 199 | -1 | -1 |
module ShouldCompile where
import Prelude ()
import Control.Monad( Monad(return), mapM )
-- Should report Monad and return as unused imports
import GHC.Base
-- But not their import from here
x = True
y x = mapM
| frantisekfarka/ghc-dsi | testsuite/tests/module/mod176.hs | bsd-3-clause | 217 | 0 | 6 | 42 | 47 | 30 | 17 | 6 | 1 |
{-# LANGUAGE NamedWildCards, ScopedTypeVariables #-}
module TidyClash2 where
barry :: forall w_. _ -> _ -> w_
barry (x :: _) (y :: _) = undefined :: _
| wxwxwwxxx/ghc | testsuite/tests/partial-sigs/should_fail/TidyClash2.hs | bsd-3-clause | 152 | 0 | 7 | 29 | 50 | 29 | 21 | 4 | 1 |
-- Matricula 1: A00368770
-- Matricula 2: A01273613
-- 1.- Medaiana calcula la mediana de 5 argumentos
-- que sean numeros enteros, regresa como valor el numero de en medio
--funcion principal
mediana :: Integer -> Integer -> Integer -> Integer -> Integer -> Integer
mediana a b c d e = numMedio (numMedio a b c) d e
... | JorgeRubio96/LenguajesdeProgramacion | a00368770_a01273613_tarea5.hs | mit | 3,696 | 14 | 12 | 888 | 1,213 | 656 | 557 | 58 | 2 |
module Ratio (Ratio, (%)) where
-- 9a)
data Ratio = Ratio
{ p :: Integer
, q :: Integer }
-- 9b)
(%) :: (Integral a, Integral b) => a -> b -> Ratio
(%) _ 0 = error "Division by zero"
(%) x y
| y > 0 = Ratio (fromIntegral x) (fromIntegral y)
| otherwise = Ratio (fromIntegral (-x)) (fromIntegral (-y))
-- 9... | kbiscanic/PUH | hw08/Ratio.hs | mit | 1,121 | 1 | 11 | 387 | 625 | 318 | 307 | 28 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module StdVector
( stdVectorCtx
, instanceStdVector
, CStdVector
, StdVector()
, StdVector.new
... | fpco/inline-c | inline-c-cpp/test/StdVector.hs | mit | 2,876 | 6 | 13 | 551 | 869 | 495 | 374 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Wikidata.Query.Label where
import Data.ByteString.Lazy (ByteString)
import Data.List (intercalate)
import Network.HTTP.Conduit
{-- A solution to the problem posted at http://lpaste.net/6471988009620209664
@1HaskellADay solution for 2016-03-01
Okay, revision 3 of today's pro... | geophf/1HaskellADay | exercises/HAD/Wikidata/Query/Label.hs | mit | 5,540 | 0 | 8 | 951 | 340 | 217 | 123 | 21 | 1 |
module Compiler.Rum.Internal.ExprParser where
import qualified Data.HashMap.Strict as HM
import Data.List (foldl')
import Text.Megaparsec
import Text.Megaparsec.String
import Compiler.Rum.Internal.AST
strSpace :: String -> Parser String
strSpace s = string s >>= \x -> space >>... | vrom911/Compiler | src/Compiler/Rum/Internal/ExprParser.hs | mit | 2,880 | 0 | 17 | 743 | 1,145 | 595 | 550 | 58 | 2 |
module Main where
import Parser
import System.Environment
main :: IO ()
main = getArgs >>= putStrLn . show . readExpr . head
| ak1t0/48hscheme | Evaluator.hs | mit | 127 | 0 | 8 | 24 | 43 | 24 | 19 | 5 | 1 |
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
-- | Reexports "Text.Read.Lex.Compat"
-- from a globally unique namespace.
module Text.Read.Lex.Compat.Repl (
module Text.Read.Lex.Compat
) where
import "this" Text.Read.Lex.Compat
| haskell-compat/base-compat | base-compat/src/Text/Read/Lex/Compat/Repl.hs | mit | 284 | 0 | 5 | 31 | 31 | 24 | 7 | 5 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -O0 #-}
{-# OPTIONS_GHC -Wno-partial-type-signatures #-}
{-# OPTIONS_GHC -fomit-interface-pragmas #-}
module... | zoomhub/zoomhub | src/ZoomHub/Storage/PostgreSQL/Schema/Schema1.hs | mit | 995 | 0 | 9 | 167 | 181 | 113 | 68 | 31 | 1 |
module Hunch.Options.CommandLine (
withOptions
, showHelpText
) where
import Options.Applicative
import Data.Monoid (mempty)
import Hunch.Constants
import Hunch.Options.Data
singleChar :: String -> ReadM Char
singleChar s | null s = readerError "empty token"
| length s > 1 = readerError $... | loganbraga/hunch | app/Hunch/Options/CommandLine.hs | mit | 3,247 | 0 | 16 | 843 | 853 | 411 | 442 | 106 | 1 |
module Strategy.Evaluation
(
winningRows,
evaluate
) where
import Control.Monad (join)
import qualified Data.Vector as V
import Board
-- |Auxiliary data type to represent the result of the evaluation function
newtype NumPair a = NumPair { tuple :: (a, a) }
-- |Adds two 'NumPair' objects by adding the comp... | joslugd/connect4-haskell | src/Strategy/Evaluation.hs | mit | 4,617 | 0 | 13 | 1,353 | 654 | 372 | 282 | 39 | 6 |
module Sproxy.Logging
( LogLevel(..)
, debug
, error
, info
, level
, start
, warn
) where
import Prelude hiding (error)
import Control.Applicative (empty)
import Control.Concurrent (forkIO)
import Control.Concurrent.Chan (Chan, newChan, readChan, writeChan)
import Control.Monad (forever, when)
import... | zalora/sproxy | src/Sproxy/Logging.hs | mit | 2,306 | 0 | 11 | 525 | 888 | 472 | 416 | 86 | 1 |
-- Copyright (c) Microsoft. All rights reserved.
-- Licensed under the MIT license. See LICENSE file in the project root for full license information.
{-# LANGUAGE QuasiQuotes, OverloadedStrings, RecordWildCards #-}
module Language.Bond.Codegen.Cs.Types_cs
( types_cs
, FieldMapping(..)
, StructMapping(..)... | jdubrule/bond | compiler/src/Language/Bond/Codegen/Cs/Types_cs.hs | mit | 7,490 | 0 | 15 | 2,054 | 1,133 | 669 | 464 | 98 | 16 |
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
import Data.Map as M
import Data.Ratio
type Symbol = String
type Array = Hash -> Double
instance Num Array where
(f + g)(x) = f x + g x
data ValueType = VS Symbol | VQ Rational | VR Double | VH Hash
instance Num ValueType where
(VQ x) + (VQ y) = VQ (x+y)
... | nushio3/formura | attic/Semantics.hs | mit | 938 | 1 | 14 | 273 | 427 | 223 | 204 | 26 | 1 |
{-# LANGUAGE GADTs #-}
module Main where
import Control.Monad.State
data M a = Foo a deriving Show
type Stack = [Int]
pop :: State Stack Int
pop = state $ \(x:xs) -> (x,xs)
push :: Int -> State Stack ()
push a = state $ \xs -> ((),a:xs)
stackManip :: State Stack Int
stackManip = do
push 3
a <- pop
... | brodyberg/Notes | GADT.hsproj/Main.hs | mit | 973 | 0 | 8 | 268 | 241 | 145 | 96 | 21 | 1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE IncoherentInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Data.Extensible.Sum1 where
import Control.Lens
import Data.Functo... | jadaska/extensible-sp | src/Data/Extensible/Sum1.hs | mit | 2,363 | 2 | 13 | 679 | 1,228 | 614 | 614 | 67 | 2 |
module Print where
import General
import Dictionary
import List (intersperse)
-- printing morphological objects as strings
prStr :: Str -> String
prStr = concat . intersperse "/" . unStr
prAlts :: Str -> String
prAlts ss =
case unStr ss of
[] -> "*"
ys -> unwords $ intersperse "/" ys
consTable :: St... | icemorph/icemorph | bin/FM/lib/Print.hs | cc0-1.0 | 11,492 | 30 | 18 | 3,047 | 3,808 | 2,047 | 1,761 | 210 | 4 |
{-# LANGUAGE BangPatterns #-}
{- BSP.hs; Mun Hon Cheong (mhch295@cse.unsw.edu.au) 2005
A module for loading Quake 3 BSP files
source code in C++ can be found at
http://www.paulsprojects.net/opengl/q3bsp/q3bsp.html
credits also go to Ben Humphrey for his excellent BSP tutorial
I might split this module... | kvelicka/frag | src/BSP.hs | gpl-2.0 | 33,668 | 0 | 20 | 9,570 | 10,868 | 5,598 | 5,270 | 769 | 4 |
module HTMLScrapper(
HTMLDoc,
parsePage,
getPage,
fetchTag,
fetchAllLinks
) where
-------------------------------------------------------------------------------
import Text.HandsomeSoup
import Text.XML.HXT.Core
import Network.URI
import Data.Maybe (mapMaybe)
import Data.List (isSuffixOf, nub)
import HTT... | carlostome/HCrawler | src/HTMLScrapper.hs | gpl-2.0 | 983 | 0 | 11 | 189 | 286 | 153 | 133 | 26 | 1 |
import qualified Data.ByteString.Lazy as BL
import Control.Monad.Error
import Control.Exception
import Data.List
import System.Console.GetOpt
import System.Environment
import System.Exit
import System.IO
import Text.Printf
import Commit
import Diff
import Index
import Log
import Object
import ObjectStore
import Pack
... | martine/gat | Gat.hs | gpl-2.0 | 4,711 | 0 | 27 | 1,250 | 1,619 | 810 | 809 | 146 | 5 |
{-
Copyright 2012, 2013, 2014 Colin Woodbury <colingw@gmail.com>
This file is part of Aura.
Aura is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later ve... | vigoos/Farrago-OS | aura-master/aura-master/src/Aura/Build.hs | gpl-2.0 | 5,098 | 0 | 16 | 989 | 1,249 | 643 | 606 | 83 | 2 |
module Main where
import Control.Monad
import qualified Data.Text.Lazy as LT
import Data.Text.Lazy (Text)
import qualified Data.Text.IO as TIO
import Data.Text.Read (decimal)
import Shelly
import Text.Shakespeare.Text (lt)
default (LT.Text, Shelly.FilePath)
type Range = [Int]
type ScreenSession = Text
data Mode = Com... | edwtjo/screen-muxer | src/main/haskell/smuxer.hs | gpl-3.0 | 3,673 | 0 | 20 | 861 | 1,247 | 637 | 610 | -1 | -1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveDataTypeable #-}
module VSim.Data.TInt where
import Data.Typeable
import Data.Generics
import Data.Int
import Data.Bits
import Foreign.Storable
import Text.Printf
newtype TInt = TInt { unTInt :: Int32 }
deriving (Eq, Ord, Num, Enum, Real, Integral, St... | grwlf/vsim | src/VSim/Data/TInt.hs | gpl-3.0 | 609 | 0 | 11 | 112 | 202 | 112 | 90 | 18 | 1 |
module Ampersand.Basics
( module Ampersand.Basics.Auxiliaries
, module Ampersand.Basics.Exit
, module Ampersand.Basics.Languages
, module Ampersand.Basics.PandocExtended
, module Ampersand.Basics.Prelude
, module Ampersand.Basics.String
, module Ampersand.Basics.Unique
, module Ampersand.Basics... | AmpersandTarski/ampersand | src/Ampersand/Basics.hs | gpl-3.0 | 666 | 0 | 5 | 79 | 125 | 86 | 39 | 19 | 0 |
{-# LANGUAGE TemplateHaskell, DeriveFunctor, FlexibleInstances, MultiParamTypeClasses #-}
module LanguageDef.Data.LanguageDef where
{-
A language defintion builds on many language-definition aspects. Each language definition aspect has its own section, for which it handles the parsing (and meta-data such as documenta... | pietervdvn/ALGT2 | src/LanguageDef/Data/LanguageDef.hs | gpl-3.0 | 14,092 | 521 | 15 | 2,556 | 3,895 | 2,204 | 1,691 | 261 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-analytics/gen/Network/Google/Resource/Analytics/Management/ProFiles/Insert.hs | mpl-2.0 | 3,904 | 0 | 17 | 878 | 470 | 280 | 190 | 78 | 1 |
module ObjD.Link.Composition (
linkFuncOp
)where
import ObjD.Link.Struct
import ObjD.Link.Env
import ObjD.Link.DataType
import ObjD.Link.Conversion
import Data.List
import qualified ObjD.Struct as D
{-----------------------------------------------------------------------------------... | antonzherdev/objd | src/ObjD/Link/Composition.hs | lgpl-3.0 | 3,843 | 46 | 30 | 1,042 | 1,456 | 725 | 731 | 98 | 18 |
module Quizz.CoreSpec (main, spec) where
import Test.Hspec
import Quizz.Core
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "Proposition datatype" $ do
describe "isValid getter" $ do
it "A valid proposition" $ do
isValid (Proposition "A" True) `shouldBe` True
it "An invalid... | blackheaven/quizz.hs | test/Quizz/CoreSpec.hs | unlicense | 2,818 | 0 | 21 | 662 | 991 | 487 | 504 | 54 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Quasar.Api.Routing where
import Control.Lens
import Control.Monad.IO.Class
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS
import Data.CaseInsensitive
import Data.Conduit (ResourceT)
import Data.Monoid
import Data.Text
import Network.HTTP.Ty... | xdcrafts/Quasar | src/Quasar/Api/Routing.hs | apache-2.0 | 1,260 | 0 | 19 | 233 | 320 | 179 | 141 | 32 | 3 |
-- | Core Process code
{-# LANGUAGE ExistentialQuantification, FlexibleInstances,
GeneralizedNewtypeDeriving,
ScopedTypeVariables,
DeriveDataTypeable,
MultiParamTypeClasses, CPP #-}
module Process (
-- * Types
Process
-- * Interface
, runP
, spa... | jlouis/combinatorrent | src/Process.hs | bsd-2-clause | 3,492 | 0 | 18 | 986 | 851 | 450 | 401 | 69 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Application.HXournal.Command
-- Copyright : (c) 2011, 2012 Ian-Woo Kim
--
-- License : BSD3
-- Maintainer : Ian-Woo Kim <ianwookim@gmail.com>
-- Stability : experimental
-- Portability : GHC
--
----------------... | wavewave/hxournal | lib/Application/HXournal/Command.hs | bsd-2-clause | 663 | 0 | 8 | 88 | 82 | 50 | 32 | 7 | 1 |
-- {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE DataKinds, GADTs, TypeFamilies #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FunctionalDependencies #-}
module UnitBLAS.Level1(unitTestLevel1BLAS) where
--import Test.HUnit
--import Numeric... | yangjueji/hblas | tests/UnitBLAS/Level1.hs | bsd-3-clause | 16,104 | 0 | 15 | 4,014 | 5,898 | 3,173 | 2,725 | 270 | 1 |
-- | Functionality for detecting and removing left-recursion.
{-# LANGUAGE FlexibleContexts #-} -- for Pretty (V t nt)
{-# LANGUAGE ScopedTypeVariables #-}
module Data.Cfg.LeftRecursion(
LR(..),
SCComp(..),
isLeftRecursive,
removeLeftRecursion,
removeLeftRecursionBounded,
reportLeftRec) where
i... | nedervold/context-free-grammar | src/Data/Cfg/LeftRecursion.hs | bsd-3-clause | 7,524 | 0 | 17 | 2,964 | 2,418 | 1,245 | 1,173 | 155 | 6 |
----------------------------------------------------------------------
-- |
-- Module : WBXML.DomBuilder
-- Copyright : Mike Limansky, 2012
-- Licencse : BSD3
--
-- Helper module for building different DOM documents
--
----------------------------------------------------------------------
module Wbxml.Dom... | limansky/wbxml | src/Wbxml/DomBuilder.hs | bsd-3-clause | 1,531 | 0 | 16 | 526 | 508 | 270 | 238 | 18 | 5 |
import Wrecker
import Wrecker.Options
import Network.HTTP.Client
import Options.Applicative.Builder
import Options.Applicative
import Control.Exception
import Control.Monad (void)
import Data.Monoid
parser :: Parser (PartialOptions, String)
parser
= (,)
<$> pPartialOptions
<*> strArgument mempty
runParser' ::... | skedgeme/wrecker | app/Main.hs | bsd-3-clause | 1,168 | 0 | 14 | 354 | 314 | 160 | 154 | 32 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.