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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
import Utils (isPerfectSquare, zipMap)
import Primes
--b^2 = (a+1)^2-a^2/4 = 3a^2/4+2a+1 = (a+2)(3a+2)/4, p = a+2(a+1) = 3a+2, A = ab/2
--b^2 = (a-1)^2-a^2/4 = 3a^2/4-2a+1 = (a-2)(3a-2)/4, p = a+2(a-1) = 3a-2, A = ab/2
pMax = 10^9
someAsPlusH = filter (\(a, h) -> isPerfectSquare h) $ zipMap (\a -> (a+2)*(3*a+2)) [2,... | arekfu/project_euler | p0094/p0094.hs | mit | 1,233 | 0 | 13 | 213 | 576 | 312 | 264 | 18 | 1 |
{-# htermination (<=) :: Ord a => (Maybe a) -> (Maybe a) -> Bool #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_LTEQ_9.hs | mit | 69 | 0 | 2 | 15 | 3 | 2 | 1 | 1 | 0 |
{- |
Module : Summoner.Template.Cabal
Copyright : (c) 2017-2022 Kowainik
SPDX-License-Identifier : MPL-2.0
Maintainer : Kowainik <xrom.xkov@gmail.com>
Stability : Stable
Portability : Portable
@.cabal@ file template.
-}
module Summoner.Template.Cab... | vrom911/hs-init | summoner-cli/src/Summoner/Template/Cabal.hs | mit | 7,368 | 0 | 17 | 2,869 | 1,193 | 676 | 517 | -1 | -1 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.Entity (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.Entity
#else
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
import GHCJS.DOM.JSFFI.Generated.Entity
#e... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/Entity.hs | mit | 331 | 0 | 5 | 33 | 33 | 26 | 7 | 4 | 0 |
{-|
Module: Capnp.Bits
Description: Utilities for bitwhacking useful for capnproto.
This module provides misc. utilities for bitwhacking that are useful
in dealing with low-level details of the Cap'N Proto wire format.
This is mostly an implementation detail; users are unlikely to need
to use this module directly.
-}... | zenhack/haskell-capnp | lib/Capnp/Bits.hs | mit | 4,175 | 0 | 12 | 890 | 1,073 | 612 | 461 | -1 | -1 |
module GHCJS.DOM.SVGEllipseElement (
) where
| manyoo/ghcjs-dom | ghcjs-dom-webkit/src/GHCJS/DOM/SVGEllipseElement.hs | mit | 47 | 0 | 3 | 7 | 10 | 7 | 3 | 1 | 0 |
-- pandoc-plantuml-filter.hs, a pandoc json filter to create inline diagrams
-- with plantuml
--
-- Copyright (C) 2015 Mark Lee Stillwell
--
-- 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, e... | marklee77/pandoc-filters | src/pandoc-plantuml-filter.hs | gpl-2.0 | 3,554 | 0 | 18 | 943 | 839 | 443 | 396 | 63 | 12 |
import Char
import List
import qualified Test.QuickCheck
import Test.QuickCheck hiding (test)
import Text.Printf
import Data.Bloom
import Data.Digest.MD5
main = mapM_ (\(s,a) -> printf "%-25s: " s >> a) tests
instance Arbitrary Char where
arbitrary = choose ('\0', '\128')
coarbitrary c = variant (ord c... | almost/Data.Bloom | Tests.hs | gpl-2.0 | 791 | 0 | 10 | 139 | 256 | 140 | 116 | 18 | 1 |
main :: IO()
main = do
print eval_module
arecord x = ("arecord", x)
setattr x = ("setattr", x)
attribute_body_type_list x = ("attribute_body_type_list", x)
attribute_body_type_list_1 x = (attribute_body_type_list x)
alist x = ("alist", x)
achain x = ("achain", x)
setrec x = ("setrec", x)
attribute_keywords_type_... | h4ck3rm1k3/gcc-ontology | tests/example_simple_python_method_ast.hs | gpl-3.0 | 17,253 | 0 | 170 | 7,713 | 3,230 | 1,700 | 1,530 | 212 | 1 |
module Amoeba.Middleware.GLFW.Facade (module GLFW, errorCallback, withEnvironment) where
import qualified Amoeba.Middleware.Tracing.Log as Log
import Amoeba.Middleware.Tracing.ErrorHandling
import Graphics.UI.GLFW as GLFW
import Control.Monad (when, unless)
errorCallback :: GLFW.ErrorCallback
errorCallback err msg =... | graninas/The-Amoeba-World | src/Amoeba/Middleware/GLFW/Facade.hs | gpl-3.0 | 661 | 0 | 11 | 114 | 169 | 90 | 79 | 15 | 1 |
module DL3044 (tests) where
import Helpers
import Test.Hspec
tests :: SpecWith ()
tests = do
let ?rulesConfig = mempty
describe "DL3044 - Do not refer to an environment variable within the same `ENV` statement where it is defined." $ do
it "ok with normal ENV" $
ruleCatchesNot "DL3044" "ENV BLA=\"blubb... | lukasmartinelli/hadolint | test/DL3044.hs | gpl-3.0 | 2,137 | 0 | 11 | 429 | 291 | 123 | 168 | -1 | -1 |
{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- Module : Gen.Orphans
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : provisional
-- Portability : non-portable (GHC exten... | brendanhay/gogol | gen/src/Gen/Orphans.hs | mpl-2.0 | 723 | 0 | 8 | 153 | 134 | 76 | 58 | 11 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | romanb/amazonka | amazonka-directconnect/gen/Network/AWS/DirectConnect/Types.hs | mpl-2.0 | 38,674 | 0 | 38 | 10,069 | 7,310 | 4,138 | 3,172 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/FloodlightActivities/Generatetag.hs | mpl-2.0 | 5,906 | 0 | 20 | 1,393 | 829 | 477 | 352 | 123 | 1 |
import System.Plugins
import System.Directory
main = do
status <- make "Foo.hs" [] -- should make
print status
status <- make "Foo.hs" [] -- shouldn't make
print status
status <- merge "Foo.hs" "Bar.hs"
case status of
MergeFailure es -> error $ unline... | Changaco/haskell-plugins | testsuite/make/remake001/Main.hs | lgpl-2.1 | 836 | 0 | 17 | 394 | 224 | 100 | 124 | 20 | 4 |
module Lupo.Import
( module Export
) where
import Control.Applicative as Export
import Control.Lens as Export
import Control.Monad as Export
import Data.Monoid as Export
import Lupo.Exception as Export
| keitax/lupo | src/Lupo/Import.hs | lgpl-3.0 | 208 | 0 | 4 | 33 | 47 | 33 | 14 | 7 | 0 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module ProjectM36.Relation.Show.CSV where
import ProjectM36.Base
import ProjectM36.Attribute as A
import Data.Csv
import ProjectM36.Tuple
import qualified Data.ByteString.Lazy as BS
import qualified Data.Vector as V
import ProjectM36.Error
import qualified Data.Text.Encoding as TE
... | agentm/project-m36 | src/lib/ProjectM36/Relation/Show/CSV.hs | unlicense | 1,991 | 0 | 12 | 314 | 439 | 237 | 202 | 30 | 1 |
{-# LANGUAGE CPP #-}
module TutorialD.Interpreter.Export.Base where
import ProjectM36.Base
import ProjectM36.Error
#if __GLASGOW_HASKELL__ < 804
import Data.Monoid
#endif
data RelVarDataExportOperator = RelVarDataExportOperator RelationalExpr FilePath (RelVarDataExportOperator -> Relation -> IO (Maybe RelationalError)... | agentm/project-m36 | src/bin/TutorialD/Interpreter/Export/Base.hs | unlicense | 664 | 0 | 12 | 75 | 146 | 78 | 68 | 10 | 1 |
{-# LANGUAGE TemplateHaskell, StandaloneDeriving, GeneralizedNewtypeDeriving #-}
module Main(main) where
import Control.Monad
import Data.Bits (shiftL)
import qualified Data.ByteString as B
import Data.Time.Clock
import Data.Ratio
import Data.Maybe (mapMaybe)
import Data.Binary (Binary)
import System.Posix.Process
i... | SKA-ScienceDataProcessor/RC | MS2/bench-programs/bench-message.hs | apache-2.0 | 2,346 | 0 | 19 | 515 | 672 | 349 | 323 | 49 | 2 |
module Main where
import qualified CorrelationService_Client as Client
import Correlation_Types
import Thrift
import Thrift.Protocol.Binary
import Thrift.Server
import Thrift.Transport
import Thrift.Transport.Handle
import Control.Exception
import Data.Array.IO
import Data.Either
import Data.Int
import Data.List
imp... | maxeler/maxskins | examples/Correlation/client/hs/AdvancedStatic/CorrelationClient.hs | bsd-2-clause | 27,428 | 551 | 21 | 5,837 | 8,997 | 4,823 | 4,174 | 388 | 29 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RecursiveDo #-}
module Zero.HitBTC.Widget
(
TickerWidget(..)
, tickerWidget
) where
import Data.Proxy (Proxy(..))
import qualified Data.Text as T
import Data.Text... | et4te/zero | src/Zero/HitBTC/Widget.hs | bsd-3-clause | 1,554 | 0 | 13 | 361 | 378 | 206 | 172 | 38 | 1 |
-- Copyright (c) 2014-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is distributed under the terms of a BSD license,
-- found in the LICENSE file.
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiP... | jiayuanmark/Haxl | Haxl/DataSource/ConcurrentIO.hs | bsd-3-clause | 2,691 | 0 | 18 | 466 | 406 | 234 | 172 | 36 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TupleSections #-}
module Main where
import qualified LoadTestData as Load
import Types
import qualified Plot
import NeuralNetworksTest.TestImpl as Test
import PatternRecogn.NeuronalNetworks as NN
import PatternRecogn.Types
import System.IO
----------------------------... | EsGeh/pattern-recognition | test/NeuralNetworksTest.hs | bsd-3-clause | 3,435 | 132 | 16 | 660 | 1,037 | 557 | 480 | 91 | 1 |
{-# LANGUAGE ForeignFunctionInterface, CPP #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.NV.RegisterCombiners2
-- Copyright : (c) Sven Panne 2013
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
--... | mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/NV/RegisterCombiners2.hs | bsd-3-clause | 1,757 | 0 | 12 | 199 | 209 | 135 | 74 | -1 | -1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
-- | Compile declarations.
module Fay.Compiler.Decl where
import Fay.Compiler.Prelude
import Fay.Comp... | fpco/fay | src/Fay/Compiler/Decl.hs | bsd-3-clause | 10,212 | 128 | 17 | 3,089 | 3,181 | 1,634 | 1,547 | 201 | 22 |
{-# LANGUAGE DeriveDataTypeable #-}
-----------------------------------------------------------------------------
-- |
-- Module : Language.C.Syntax.Attributes
-- Copyright : (c) [1995..1999] Manuel M. T. Chakravarty
-- (c) 2008 Benedikt Huber (stripped radically)
-- License : BSD-style
-- ... | jthornber/language-c-ejt | src/Language/C/Data/Node.hs | bsd-3-clause | 4,546 | 7 | 13 | 989 | 988 | 525 | 463 | 73 | 2 |
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Data.Trie.Rooted where
import Control.Applicative
import Data.List.NonEmpty hiding (head, tail)
import qualified Data.List.NonEmpty as NE
import Data.Monoid... | athanclark/pseudo-trie | src/Data/Trie/Rooted.hs | bsd-3-clause | 3,963 | 0 | 19 | 1,342 | 1,763 | 896 | 867 | 83 | 11 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BangPatterns #-}
module Reflex.Dom.Brownies.PixelCanvas (
PixelRGBA8(..)
, ICoord
, PixelFunction
, pixelCanvasAttr
)
where
import Reflex.Dom
import Reflex.Dom.Brownies.LowLevel (clampedArrayFromBS)
import GHCJS.DOM.Ty... | hansroland/reflex-dom-brownies | src/Reflex/Dom/Brownies/PixelCanvas.hs | bsd-3-clause | 5,364 | 0 | 12 | 1,397 | 1,125 | 610 | 515 | 81 | 1 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.NV.ConditionalRender
-- Copyright : (c) Sven Panne 2013
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : portabl... | mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/NV/ConditionalRender.hs | bsd-3-clause | 856 | 0 | 4 | 114 | 54 | 43 | 11 | 8 | 0 |
module Andromeda.Types.Hardware.Types where
import qualified Data.ByteString.Char8 as BS
type PhysicalAddress = BS.ByteString
type ComponentIndex = BS.ByteString
type ComponentInstanceIndex = (PhysicalAddress, ComponentIndex)
type HardwareName = BS.ByteString
type Description = BS.ByteString
class ControllerLike a ... | graninas/Andromeda | src/Andromeda/Types/Hardware/Types.hs | bsd-3-clause | 534 | 0 | 8 | 68 | 126 | 75 | 51 | 13 | 0 |
module UnclosedBracketsKata.Day2 (brackets) where
brackets :: String -> Int
brackets = foldl (\ acc v -> acc + bracketToInt v) 0
where
bracketToInt :: Char -> Int
bracketToInt '(' = 1
bracketToInt ')' = -1
| Alex-Diez/haskell-tdd-kata | old-katas/src/UnclosedBracketsKata/Day2.hs | bsd-3-clause | 259 | 0 | 9 | 88 | 76 | 41 | 35 | 6 | 2 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveDataTypeable #-}
-- |
-- Module : Crypto.Number.ModArithmetic
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : experimental
-- Portability : Good
module Crypto.Number.ModArithmetic
(
-- * Exponentiation
... | tekul/cryptonite | Crypto/Number/ModArithmetic.hs | bsd-3-clause | 3,224 | 0 | 14 | 773 | 594 | 333 | 261 | 49 | 2 |
{-
-
- Copyright (c) 2009-2010 Johnny Morrice
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation
- files (the "Software"), to deal in the Software without
- restriction, including without limitation the rights to use, copy,
- modif... | ozataman/shpider | Network/Shpider/Pairs.hs | mit | 1,941 | 0 | 9 | 450 | 175 | 107 | 68 | -1 | -1 |
{-# LANGUAGE RecordWildCards #-}
module Main
( main
) where
import Data.Proxy (Proxy (..))
import Language.PureScript.Bridge (BridgePart, buildBridge,
defaultBridge, mkSumType, typeName, writePSTypes, (<|>),
(^==))
import Language.P... | input-output-hk/pos-haskell-prototype | explorer/src/purescript/Main.hs | mit | 2,362 | 0 | 13 | 620 | 664 | 360 | 304 | -1 | -1 |
-- -*- mode: haskell -*-
{-# LANGUAGE TemplateHaskell #-}
module Convert.Wanted where
import Autolib.Reader
import Autolib.ToDoc
import Data.Typeable
import qualified NFA.Property
import qualified Exp.Property
import Autolib.NFA ( NFAC )
data NFAC c Int =>
Wanted c = NFA [ NFA.Property.Property c ]
... | florianpilz/autotool | src/Convert/Wanted.hs | gpl-2.0 | 431 | 0 | 9 | 85 | 117 | 68 | 49 | -1 | -1 |
{- |
Module : ./SoftFOL/DFGParser.hs
Description : A parser for the SPASS Input Syntax
Copyright : (c) C. Immanuel Normann, Heng Jiang, C.Maeder, Uni Bremen 2007
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : portable
A parse... | spechub/Hets | SoftFOL/DFGParser.hs | gpl-2.0 | 13,820 | 2 | 30 | 3,953 | 4,199 | 2,094 | 2,105 | 389 | 5 |
module ExprLambdaUnusedVar where
main :: Int
main = (\a -> 0) main | roberth/uu-helium | test/staticwarnings/ExprLambdaUnusedVar.hs | gpl-3.0 | 69 | 0 | 7 | 14 | 25 | 15 | 10 | 3 | 1 |
module Main where
import Math.Probably.Sampler
import Math.Probably.RandIO
import Math.Probably.FoldingStats
import Numeric.LinearAlgebra
import Math.Probably.Unscented
import Graphics.Gnewplot.Exec
import Graphics.Gnewplot.Types
import Graphics.Gnewplot.Style
import Graphics.Gnewplot.Panels
import Graphics.Gnewpl... | glutamate/probably-base | testUKF.hs | bsd-3-clause | 2,393 | 1 | 17 | 703 | 971 | 520 | 451 | 57 | 1 |
module Main (main) where
import Control.Monad
import Control.Applicative
import Data.List (find, unfoldr, break, isPrefixOf, intercalate)
import Test.Hspec
import System.Directory
import qualified Data.Text as T
import qualified Data.Text.Lazy as L
import qualified Da... | eigengrau/hindent | test/Spec.hs | bsd-3-clause | 3,020 | 0 | 15 | 840 | 966 | 508 | 458 | 68 | 5 |
{-# LANGUAGE FlexibleContexts #-}
module CV.ImageOp where
import System.IO.Unsafe (unsafePerformIO)
import CV.Image
import Control.Monad ((>=>))
import Data.Monoid
import Control.Category
import Prelude hiding ((.),id)
-- |ImageOperation is a name for unary operators that mutate images inplace.
newtype ImageOperation... | TomMD/CV | CV/ImageOp.hs | bsd-3-clause | 2,266 | 0 | 12 | 536 | 768 | 399 | 369 | 35 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Test.Framework (defaultMain)
import Text.XmlHtml.Tests (tests)
main :: IO ()
main = defaultMain tests
| 23Skidoo/xmlhtml | test/suite/TestSuite.hs | bsd-3-clause | 185 | 0 | 6 | 44 | 44 | 26 | 18 | 6 | 1 |
module Main where
-- imports everything
import Csound.Base
-- Let's define a simple sound unit that
-- reads in cycles the table that contains a single sine partial.
-- oscil1 is the standard oscillator with linear interpolation.
-- 1 - means the amplitude, cps - is cycles per second and the last argument
-- is the... | isomorphism/csound-expression | examples/Midi.hs | bsd-3-clause | 1,041 | 0 | 8 | 220 | 141 | 81 | 60 | 8 | 1 |
-- A Pandoc filter to make beamer presentations
-- Matti Pastell 2011 <matti.pastell@helsinki.fi>
-- Requires Pandoc 1.8
import Text.Pandoc
import Text.Pandoc.Shared
main = interact $ jsonFilter $ bottomUp beamer
beamer :: Block -> Block
beamer (Header 1 text) = RawBlock "latex"
(concat ["\\end{frame}\n\n"... | david415/tails | wiki/src/promote/slides/Tails-SIT_conference-201206/pandoc-filters/beamer.hs | gpl-3.0 | 906 | 0 | 10 | 245 | 201 | 110 | 91 | 16 | 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="ms-MY">
<title>Core Language Files | ZAP Extension</title>
<maps>
<homeID>top</homeID>
... | thc202/zap-extensions | addOns/coreLang/src/main/javahelp/org/zaproxy/zap/extension/coreLang/resources/help_ms_MY/helpset_ms_MY.hs | apache-2.0 | 980 | 78 | 66 | 160 | 415 | 210 | 205 | -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="ar-SA">
<title>AMF Support</title>
<maps>
<homeID>amf</homeID>
<mapref location="map.jh... | thc202/zap-extensions | addOns/amf/src/main/javahelp/help_ar_SA/helpset_ar_SA.hs | apache-2.0 | 956 | 77 | 66 | 156 | 407 | 206 | 201 | -1 | -1 |
{-# LANGUAGE TypeFamilies #-}
module Small where
import Data.Kind (Type)
class CoCCC k where
type Coexp k :: Type -> Type -> Type
type Sum k :: Type -> Type -> Type
coapply' :: k b (Sum k (Coexp k a b) a)
cocurry' :: k c (Sum k a b) -> k (Coexp k b c) a
uncocurry' :: k (Coexp k... | sdiehl/ghc | testsuite/tests/indexed-types/should_compile/T2291.hs | bsd-3-clause | 873 | 0 | 11 | 261 | 310 | 160 | 150 | -1 | -1 |
-- gaussian_integers.hs
-- to find prime numbers in Gaussian integers
import Data.Complex
-- merge two sorted sequence
-- f is a function that helps to compare
merge :: Ord b => (a -> b) -> [a] -> [a] -> [a]
merge _ xs [] = xs
merge _ [] ys = ys
merge f u@(x:xs) v@(y:ys)
| f x > f y = y : merge f u ys
| f x <= f... | sclereid/collections | haskell-learning/gaussian_integers.hs | mit | 2,520 | 0 | 20 | 968 | 1,252 | 670 | 582 | 47 | 2 |
{-
|
-}
module Game
( GameState(..)
, initState
) where
import Control.Monad.Trans
import Control.Monad.Trans.State
import Game.State
import Game.Loop
import Game.Menu
import Resources
-- |Initializes the game state
-- @todo probably it's better to run all state-related calculations
-- in environment/s... | vTurbine/w3dhs | src/Game.hs | mit | 3,178 | 0 | 8 | 1,893 | 376 | 256 | 120 | 57 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Tests.Database.Toxic.Streams (streamsTests) where
import qualified Data.Map.Strict as M
import qualified Data.Vector as V
import Database.Toxic.Aggregates
import Database.Toxic.Streams
import Database.Toxic.Types
import Test.Framework
import Test.Framework.Providers.HUnit (... | MichaelBurge/ToxicSludgeDB | Tests/Database/Toxic/Streams.hs | mit | 3,944 | 0 | 14 | 1,068 | 1,133 | 626 | 507 | 88 | 1 |
{-
Minisculus AST
================
James Sullivan
<sullivan.james.f@gmail.com>
Defines the AST data structure for the Minisculus Language.
Includes a function fromParseTree :: ParseTree -> AST that
transforms a completed parse tree to an AST.
-}
module MinisculusAST where
import Mini... | JamesSullivan1/Minisculus | src/MinisculusAST.hs | mit | 3,258 | 0 | 13 | 907 | 1,305 | 645 | 660 | 85 | 1 |
module Sprockell.TypesEtc where
import Data.Int (Int32)
import Data.Array (Ix)
import Sprockell.Components
-- ==========================================================================================================
-- Sprockell instructions
data Instruction =
Compute Operator Reg Reg Reg -- Comput... | martijnbastiaan/sprockell | src/Sprockell/TypesEtc.hs | mit | 5,588 | 0 | 9 | 2,415 | 759 | 473 | 286 | 106 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafregional-sizeconstraintset-fieldtomatch.html
module Stratosphere.ResourceProperties.WAFRegionalSizeConstra... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/WAFRegionalSizeConstraintSetFieldToMatch.hs | mit | 2,351 | 0 | 13 | 213 | 266 | 152 | 114 | 28 | 1 |
module ParsingGame.Application
(Application,
ApplicationState(..),
applicationInit,
applicationExit)
where
import Control.Concurrent.MVar
import Control.Monad.Trans.State
data ApplicationState = ApplicationState
type Application = StateT ApplicationState IO
applicationInit :: IO (Maybe (MVar Applicat... | IreneKnapp/parsing-game | Haskell/ParsingGame/Application.hs | mit | 583 | 0 | 9 | 84 | 143 | 75 | 68 | 17 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html
module Stratosphere.Resources.ApplicationAutoScalingScalingPolicy whe... | frontrowed/stratosphere | library-gen/Stratosphere/Resources/ApplicationAutoScalingScalingPolicy.hs | mit | 7,267 | 0 | 15 | 568 | 813 | 462 | 351 | 63 | 1 |
{-# 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
-- P... | formrre/yi | yi-core/src/Yi/Editor.hs | gpl-2.0 | 30,718 | 0 | 24 | 8,969 | 7,055 | 3,713 | 3,342 | -1 | -1 |
import Data.Set as Set
main = do
let xs = Set.fromList [[1,2],[3,4],[3]]
ys = Set.fromList [[3,4],[5],[6]]
zs = xs `union` ys
putStrLn $ show $ toList xs
putStrLn $ show $ toList ys
putStrLn $ show $ toList zs
| bredelings/BAli-Phy | tests/haskell/Ord/3/Main.hs | gpl-2.0 | 231 | 0 | 12 | 60 | 135 | 74 | 61 | 8 | 1 |
module SpacialGame.SGModel where
import System.Random
import Data.Maybe
import Data.List
import qualified MinABS as ABS
import qualified Data.Map as Map
------------------------------------------------------------------------------------------------------------------------
-- DOMAIN-SPECIFIC AGENT-DEFINITIONS
data S... | thalerjonathan/phd | coding/prototyping/haskell/declarativeABM/haskell/MinABS/src/SpacialGame/SGModel.hs | gpl-3.0 | 8,701 | 0 | 15 | 2,934 | 2,240 | 1,228 | 1,012 | 155 | 2 |
-- These problems from projecteuler.net
--
-- Problem 7
-- By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13,
-- we can see that the 6th prime is 13.
-- What is the 10 001st prime number?
import Numbering
solution = (filter (is_prime) [1..]) !! (10001 - 1) -- indexing starts from 0
| susu/haskell-problems | ProjectEuler/problem7.hs | gpl-3.0 | 298 | 0 | 8 | 60 | 41 | 26 | 15 | 2 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
module Nirum.Parser ( Parser
, ParseError
, aliasTypeDeclaration
, annotation
, annotationSet
, docs
, enumTypeDeclara... | dahlia/nirum | src/Nirum/Parser.hs | gpl-3.0 | 22,166 | 0 | 21 | 7,116 | 5,339 | 2,575 | 2,764 | 580 | 4 |
-- Copyright (c) 2014 Contributors as noted in the AUTHORS file
--
-- 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 3 of the License, or
-- (at your option) any later version.
-... | rickardlindberg/frp-arduino-old | examples/Blink.hs | gpl-3.0 | 791 | 0 | 9 | 144 | 40 | 27 | 13 | 3 | 1 |
module Data.Strict.Maybe.Util
( catMaybes
, unionWith
) where
import qualified Data.Maybe as Unstrict
import Data.Strict.Maybe
import Prelude hiding (Maybe(..), maybe)
catMaybes :: [Maybe a] -> [a]
catMaybes = Unstrict.mapMaybe (maybe Unstrict.Nothing Unstrict.Just)
unionWith :: (a -> a -> a) -> Maybe a ... | davidspies/regret-solver | game/src/Data/Strict/Maybe/Util.hs | gpl-3.0 | 390 | 0 | 8 | 75 | 152 | 85 | 67 | 10 | 1 |
module H99.Problem17
(split) where
split :: [a] -> Int -> ([a], [a])
split xs n = let prefix = take n xs
remainder = drop n xs
in (prefix, remainder)
| shimanekb/H-99SetTwo | problem17/src/H99/Problem17.hs | gpl-3.0 | 185 | 0 | 9 | 65 | 81 | 45 | 36 | 6 | 1 |
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE BangPatterns #-}
module Utils.Decoding where
import Data.Maybe
import Data.ByteString.Lazy
import Control.DeepSeq
import Control.Monad
import System.Random (randomIO)
import Test.QuickCheck.Random (mkQCGen)
import Test.QuickCheck.Gen
import Test.QuickFuzz.Gen.FormatInfo
... | CIFASIS/QuickFuzz | app/Utils/Decoding.hs | gpl-3.0 | 3,014 | 0 | 15 | 771 | 796 | 401 | 395 | 61 | 3 |
module Expr where
import Data.List ((\\), union)
import Control.Monad.Except (throwError)
-- import Data.Maybe (fromMaybe)
import Syntax
import Utils
-- import Parser
-- | Substitution function
subst :: Sym -> Expr -> Expr -> Expr
subst v x = sub
where sub e@(Var i) = if i == v then x else e
sub (App f a) ... | bixuanzju/full-version | src/Expr.hs | gpl-3.0 | 6,954 | 0 | 28 | 2,343 | 2,898 | 1,466 | 1,432 | 128 | 17 |
module System.DevUtils.Parser.Lines (
) where
| adarqui/DevUtils-Parser | src/System/DevUtils/Parser/Lines.hs | gpl-3.0 | 46 | 0 | 3 | 5 | 11 | 8 | 3 | 1 | 0 |
{-# Language TemplateHaskell #-} -- For Lenses
-- Players, Monsters, Stats, etc
module GameState.Creatures where
import Data.Maybe
import Control.Lens
-- ie HP, MP
data Resource = Resource { _cap :: Int
, _current :: Int
} deriving Eq
-- "smart constr... | lordcirth/haskell-rogue | src/GameState/Creatures.hs | gpl-3.0 | 2,161 | 0 | 9 | 957 | 354 | 205 | 149 | 37 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-factchecktools/gen/Network/Google/Resource/FactCheckTools/Pages/Delete.hs | mpl-2.0 | 4,309 | 0 | 15 | 1,026 | 694 | 405 | 289 | 99 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-ml/gen/Network/Google/Resource/Ml/Projects/Jobs/Patch.hs | mpl-2.0 | 6,088 | 0 | 17 | 1,385 | 867 | 509 | 358 | 123 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
module Action
( Request
, RequestContext
, Databrary.Handler
, Action
, Response
, response
, emptyResponse... | databrary/databrary | src/Action.hs | agpl-3.0 | 3,727 | 0 | 13 | 738 | 692 | 398 | 294 | 83 | 1 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE TemplateHaskell #-}
module Blick.Types where
import Data.Aeson as Aeson
import Data.Maybe (Maybe)
import qualified Data.SafeCopy as SafeCopy
import ... | erik/sketches | projects/blick/src/Blick/Types.hs | agpl-3.0 | 801 | 0 | 9 | 196 | 168 | 100 | 68 | 21 | 0 |
module FirstScript where
size :: Integer
size = 12+13
square :: Integer -> Integer
square n = n * n
double :: Integer -> Integer
double n = 2 * n
example :: Integer
example = double ( size - square ( 2 + 2 ))
squaredouble :: Integer -> Integer
squaredouble n = square ( double ( n))
doublesquare :: Integer -> Inte... | itteerde/OpenCourseWare | Computer Science/Programming Languages/Haskell/Haskell - the craft of functional programming/FirstScript.hs | unlicense | 361 | 0 | 10 | 76 | 148 | 79 | 69 | 13 | 1 |
import Data.List
subseqs :: [a] -> [[a]]
subseqs [] = []
subseqs (x:xs) = [x] : foldr f [] (subseqs xs)
where f ys y = ys : (x:ys) : y
sortedseqs :: Ord a => [a] -> [[a]]
sortedseqs = sort . subseqs . sort
testCases [] = return ()
testCases (x:y:xs) = do
putStr $ unlines $ sortedseqs $ take (read x) y
te... | itsbruce/hackerrank | alg/discrete/buildAList.hs | unlicense | 422 | 0 | 11 | 117 | 247 | 125 | 122 | 15 | 1 |
{-| Executing jobs as processes
The protocol works as follows (MP = master process, FP = forked process):
* MP sets its own livelock as the livelock of the job to be executed.
* FP creates its own lock file and sends its name to the MP.
* MP updates the lock file name in the job file and confirms the FP it can
st... | dimara/ganeti | src/Ganeti/Query/Exec.hs | bsd-2-clause | 10,873 | 0 | 33 | 2,650 | 1,809 | 918 | 891 | 140 | 4 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QIcon.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:36
Warning : this file is machine generated - do not mod... | keera-studios/hsQt | Qtc/Enums/Gui/QIcon.hs | bsd-2-clause | 4,090 | 0 | 18 | 966 | 1,148 | 571 | 577 | 102 | 1 |
{-| FreeBSD primitives
Dependencies:
- pkgng
- optionsNG
-}
module Config.Snappy.Platform.FreeBSD where
import Config.Snappy
import System.Directory
import System.Process
import System.Exit
-- |Root directory for ports tree
portsRoot :: String
portsRoot = "/usr/ports"
-- |Users base directory
usersBa... | ppenzin/snappy | src/Config/Snappy/Platform/FreeBSD.hs | bsd-2-clause | 2,432 | 0 | 14 | 613 | 560 | 314 | 246 | 40 | 1 |
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE TemplateHaskell #-}
module TH where
import Language.Haskell.TH
decl :: Q [Dec]
decl = [d| f x = x|]
| haskell/haddock | html-test/src/TH.hs | bsd-2-clause | 145 | 0 | 6 | 27 | 32 | 22 | 10 | 6 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Application
( makeApplication
, getApplicationDev
, makeFoundation
) where
import Import
import Settings
import Yesod.Auth
import Yesod.Default.Config
import Yesod.Default.Main
import Yesod.Default.Handlers
import Network.Wai.Middleware.RequestLogger
( m... | kobayashi1027/nomnichi-haskell | Application.hs | bsd-2-clause | 3,811 | 0 | 13 | 741 | 660 | 365 | 295 | -1 | -1 |
module Data.SymReg.Misc(
randomNode
, insertNodeAt
, randomBounded
, calcHeight
, Breadcrumb
, Height
, Depth
) where
import Control.Monad.Random
import qualified Data.List as L
import Data.SymReg.AST
type Breadcrumb = [Int]
type Height = Int
type Depth = Int
calcChildren :: AST -> Int
calcChildre... | Teaspot-Studio/genmus | src/Data/SymReg/Misc.hs | bsd-3-clause | 2,280 | 0 | 16 | 500 | 1,060 | 575 | 485 | 61 | 4 |
{-# LANGUAGE OverloadedStrings, TemplateHaskell #-}
module Gifter.Config
( Config(..)
, sessionId
, pollDelay
, requestDelay
, maxRetries
, retryDelay
, accPointsExpire
, steamGamesExpire
, enter
, cfgDir
, stateDir
, EntryCondition
, ConfigError(..)
, emptyConfig... | arjantop/gifter | src/Gifter/Config.hs | bsd-3-clause | 2,541 | 0 | 23 | 890 | 603 | 336 | 267 | 79 | 3 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
module Logging
( debug,
info,
Logging.error,
mkConfig,
Config
) where
import Control.Monad.Logger
import Control.Monad.Reader
import qualified Data.Text.Lazy as L
import qualified Data.Text as T
mkConfig modu... | k4smiley/Chan | src/Logging.hs | bsd-3-clause | 906 | 0 | 10 | 204 | 291 | 160 | 131 | 28 | 1 |
{-# LANGUAGE MultiParamTypeClasses, TypeFamilies, FunctionalDependencies, FlexibleContexts #-}
module Lcars.DHT.Classes (DHT(..)) where
import Data.Bits
import qualified Data.ByteString as BS
import qualified Data.Serialize as Ser
import Data.List
import Crypto.Types
import Control.Monad.IO.Class
class (MonadIO m, F... | alios/lcars | Lcars/DHT/Classes.hs | bsd-3-clause | 3,476 | 0 | 25 | 1,259 | 1,283 | 645 | 638 | 92 | 0 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module AutoCompare (benchmark, sanityCheck) where
import Control.DeepSeq
import Control.Monad
import Criterion.Main
import Data.Aeson
import qualified Auto.T.D as T
import qualified Auto.T.BigRecord as T
import qualified Auto.T.BigProduct as T
import q... | dmjio/aeson | benchmarks/bench/AutoCompare.hs | bsd-3-clause | 1,993 | 0 | 15 | 495 | 676 | 356 | 320 | 54 | 2 |
{-# LANGUAGE GADTs, DataKinds, KindSignatures, OverloadedStrings #-}
module Geordi.Response where
import Geordi.Util.Exists
import Blaze.ByteString.Builder
import Blaze.ByteString.Builder.ByteString
import Blaze.ByteString.Builder.Char.Utf8
import Data.Conduit
import qualified Network.HTTP.Types.Header as H
import qu... | liamoc/geordi | Geordi/Response.hs | bsd-3-clause | 2,383 | 0 | 10 | 530 | 756 | 421 | 335 | 52 | 1 |
module Struct.Queue.Deque (PersistentDeque, fromList) where
import Prelude hiding (head, tail, init, last, foldr)
import Control.Applicative
import Data.Monoid
import Data.Foldable
import Data.Traversable
import Struct.Interfaces.Queue
loadFactor :: Int
loadFactor = 2
data PersistentDeque a = PD [a] [a] Int Int
bal... | roman-kashitsyn/pfds | src/Struct/Queue/Deque.hs | bsd-3-clause | 2,171 | 0 | 10 | 590 | 1,051 | 543 | 508 | 46 | 1 |
module Main where
import qualified Spec.Blogger as Blogger
import qualified Spec.IO as IO
import qualified Spec.OutputFormat as OutputFormat
import qualified Spec.Wordpress as Wordpress
import Test.Tasty (defaultMain, testGroup)
main :: IO ()
main =
defaultMain $
testGroup
"Spec tests"
[ Blogger.tes... | kowey/hakyll-convert | test/spec/Main.hs | bsd-3-clause | 402 | 0 | 8 | 94 | 93 | 59 | 34 | 15 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Documentation (
docs
, index
, languages
, try) where
import Evalso.Cruncher.Language ()
import qualified Evalso.Cruncher.Language as DCL
import qualified Evalso.Cruncher.Language.Everything as DCLE
import qualified Evalso.Cruncher.Unsandboxed as Unsandboxed
import... | eval-so/frontend3 | src/handlers/Documentation.hs | bsd-3-clause | 3,628 | 0 | 24 | 766 | 1,024 | 552 | 472 | 69 | 1 |
module Control.Concurrent.BMChan
( BMChan
, newBMChan
, readBMChan
, writeBMChan
, isClosedBMChan
, closeBMChan
)
where
import Control.Concurrent
import Data.IORef
import Data.Vector.Mutable (IOVector)
import qualified Data.Vector.Mutable as V
import Prelude ... | qnikst/iochan-conduit | Control/Concurrent/BMChan.hs | bsd-3-clause | 2,489 | 0 | 17 | 899 | 878 | 425 | 453 | 73 | 3 |
{-# LANGUAGE OverloadedStrings #-}
module Config where
import Control.Exception (try)
import Control.Monad.Except (ExceptT(..), withExceptT)
import Data.Aeson (FromJSON(..), Value(..), (.:))
import qualified Data.ByteString.Lazy as BS
import Data.Text.Lazy ... | savannidgerinel/health | src/Config.hs | bsd-3-clause | 1,897 | 0 | 17 | 634 | 501 | 278 | 223 | 40 | 1 |
module Text.ICalendar.Parser.ValidatorSpec
( main
, spec
) where
-- haskell platform libraries
import Text.Parsec.Prim
-- foreign libraries
import Test.Hspec
import Text.Parsec.Permutation
-- native libraries
import Spec.Expectations
import Spec.Helpers
import Text.ICalendar.Parser.Validator
main :: IO ()
main = hs... | Jonplussed/iCalendar | test/Text/ICalendar/Parser/ValidatorSpec.hs | bsd-3-clause | 3,872 | 0 | 16 | 950 | 827 | 402 | 425 | 76 | 1 |
-- -----------------------------------------------------------------------------
--
-- (c) The University of Glasgow 2012
--
-- Monadic streams
--
-- -----------------------------------------------------------------------------
module Stream (
Stream(..), yield, liftIO,
collect, fromList,
Stream.map, Strea... | ekmett/ghc | compiler/utils/Stream.hs | bsd-3-clause | 3,357 | 0 | 18 | 856 | 946 | 484 | 462 | 48 | 2 |
{-# LANGUAGE GADTs, RecordWildCards, MagicHash, ScopedTypeVariables, CPP,
UnboxedTuples #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
-- |
-- Execute GHCi messages
--
module GHCi.Run
( run, redirectInterrupts
, toSerializableException, fromSerializableException
) where
import GHCi.CreateBCO
import GHCi.I... | gridaphobe/ghc | libraries/ghci/GHCi/Run.hs | bsd-3-clause | 13,101 | 0 | 18 | 2,866 | 2,881 | 1,402 | 1,479 | 220 | 33 |
module System.Win32.Com.Server.ClassInfo
(
mkIProvideClassInfo
, mkIProvideClassInfo2
, IProvideClassInfo(..)
, IProvideClassInfo_
, iidIProvideClassInfo
, IProvideClassInfo2(..)
, IProvideClassInfo2_
, iidIProvideClassInfo2
... | HJvT/com | System/Win32/Com/Server/ClassInfo.hs | bsd-3-clause | 3,310 | 0 | 21 | 848 | 982 | 491 | 491 | 85 | 2 |
{-# LANGUAGE DeriveGeneric #-}
module Types
( DWIInfo (..)
, DWIPair (..)
, PhaseDirection (..)
, DirType (..)
) where
import Data.Yaml
import GHC.Generics
data DirType = Pos | Neg
deriving (Show, Generic)
data DWIInfo = DWIInfo
{_pid :: Int
,_dirType ... | reckbo/hs-hcp-pipeline | src/Types.hs | bsd-3-clause | 859 | 0 | 9 | 275 | 232 | 137 | 95 | 31 | 0 |
{-|
Functionality to export different parts of the orgmode data structure tree.
All parts have functions to export them separately.
-}
module Database.OrgMode.Export.OrgParse where
import Data.Maybe (isNothing)
import Data.OrgMode.Parse.Types
import Database.Persist (Entity(..))
import q... | rzetterberg/orgmode-sql | lib/Database/OrgMode/Export/OrgParse.hs | bsd-3-clause | 6,413 | 0 | 15 | 1,658 | 1,306 | 706 | 600 | 92 | 2 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
module Types where
import Control.Monad.State.Strict
import Data.Array
import Lens.Simple
import UI.NCurses
-- | Main monad
type Game a = StateT GameState Curses a
-- | Global state
data GameState = GameState
{ _gPlayer :: Player... | alvare/tateti-tateti | src/Types.hs | bsd-3-clause | 1,768 | 0 | 13 | 464 | 492 | 278 | 214 | 50 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Distribution.Cab.GenPaths (genPaths) where
import Control.Exception
import Control.Monad
import Data.List (isSuffixOf)
import Distribution.Cab.Utils (readGenericPackageDescription, unPackageName)
import Distribution.Package (pkgName, pkgVersion)
import Distribution.PackageDes... | kazu-yamamoto/cab | Distribution/Cab/GenPaths.hs | bsd-3-clause | 1,734 | 0 | 19 | 473 | 495 | 250 | 245 | 45 | 2 |
module Module4.Task24 where
data Tree a = Leaf a | Node (Tree a) (Tree a)
avg :: Tree Int -> Int
avg t =
let (c,s) = go t
in s `div` c
where
go :: Tree Int -> (Int,Int)
go (Leaf x) = (1, x)
go (Node l r) = let
(lc, ls) = go l
(rc, rs) = go r
in (lc + rc, ls + ... | dstarcev/stepic-haskell | src/Module4/Task24.hs | bsd-3-clause | 325 | 0 | 11 | 130 | 188 | 100 | 88 | 12 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
module TodoArguments (
TodoCommand(..),
getCommandInput
) where
import System.Console.CmdArgs.Implicit
data TodoCommand
= Show
{ userLevel :: Bool
, showEntireHierarchy :: Bool
, showDone :: Bool
, ... | robertmassaioli/hdo | src/TodoArguments.hs | bsd-3-clause | 10,751 | 0 | 13 | 4,328 | 1,554 | 812 | 742 | 229 | 1 |
{-# LANGUAGE TemplateHaskell #-}
module QCommon.SearchPathT where
import Control.Lens (makeLenses)
import qualified Data.ByteString as B
import Types
makeLenses ''SearchPathT
newSearchPathT :: SearchPathT
newSearchPathT = SearchPathT "" Nothing | ksaveljev/hake-2 | src/QCommon/SearchPathT.hs | bsd-3-clause | 271 | 0 | 6 | 53 | 51 | 30 | 21 | 8 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Text.Words
import Test.Hspec
import qualified Data.Vector as V
main :: IO ()
main =
hspec $
do describe "word splitting" $
do it "should work for german" $
extractWords' TiNoJapanese "Hallo, das ist ein deutscher Te... | thitp/extract-words | test/Spec.hs | bsd-3-clause | 1,455 | 0 | 14 | 487 | 273 | 156 | 117 | 25 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.