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 OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
-----------------------------------------------------------------------------
-- | DBSocketT transformer which signs and issues network requests.
---------------------... | jnonce/azure-docdb | lib/Azure/DocDB/SocketMonad/DBSocketT.hs | bsd-3-clause | 5,678 | 0 | 17 | 1,211 | 1,436 | 765 | 671 | 115 | 3 |
import Test.Hspec
import Control.Comonad.Cofree.Cofreer.Spec
import Control.Monad.Free.Freer.Spec
import GL.Shader.Spec
import UI.Layout.Spec
main :: IO ()
main = hspec . parallel $ do
describe "Control.Comonad.Cofree.Cofreer.Spec" Control.Comonad.Cofree.Cofreer.Spec.spec
describe "Control.Monad.Free.Freer.Spec" C... | robrix/ui-effects | test/Spec.hs | bsd-3-clause | 450 | 0 | 9 | 42 | 109 | 63 | 46 | 11 | 1 |
-- | A name binding context, or environment.
module Hpp.Env where
import Hpp.Types (Macro)
-- | A macro binding environment.
type Env = [(String, Macro)]
-- | Delete an entry from an association list.
deleteKey :: Eq a => a -> [(a,b)] -> [(a,b)]
deleteKey k = go
where go [] = []
go (h@(x,_) : xs) = if x == ... | bitemyapp/hpp | src/Hpp/Env.hs | bsd-3-clause | 731 | 0 | 13 | 194 | 295 | 165 | 130 | 13 | 3 |
module Dice where
import Control.Monad (liftM)
import Control.Monad.Random
import Data.List (intercalate)
data DiceBotCmd =
Start
| Quit
| Roll { cmdDice :: [Die] }
| None
| Bad { cmdBad :: String }
deriving (Show, Eq)
data Die =
Const { dieConst :: Int }
| Die { dieNum :: Int, dieType :: Int }
... | haskell-ro/hs-dicebot | Dice.hs | bsd-3-clause | 873 | 0 | 9 | 204 | 374 | 200 | 174 | 28 | 2 |
import Data.Either
import Test.Hspec
import qualified Text.Parsec as P
import Lib
import Lexer as L
import Parser as P
program = unlines
[ "dong inflate."
, "[ 3 ] value."
, "[ :x | x name ] value: 9."
]
lexerSpec = do
describe "parseToken" $ do
let parseToken = P.parse L.parseToken "(spec)"
it... | rjeli/luatalk | test/Spec.hs | bsd-3-clause | 5,511 | 0 | 34 | 2,053 | 1,546 | 738 | 808 | 111 | 1 |
{-# LANGUAGE LambdaCase #-}
module Main (main) where
import System.Environment (getArgs)
eyes = cycle ["⦿⦿", "⦾⦾", "⟐⟐", "⪽⪾", "⨷⨷", "⨸⨸", "☯☯", "⊙⊙", "⊚⊚", "⊛⊛", "⨕⨕", "⊗⊗", "⊘⊘", "⊖⊖", "⁌⁍", "✩✩", "❈❈"]
shells = cycle ["()", "{}", "[]", "⨭⨮", "⨴⨵", "⊆⊇", "∣∣"]
bodies = cycle ["███", "XXX", "⧱⧰⧱", "⧯⧮⧯", "⧲⧳⧲","🁢�... | getmillipede/millipede-haskell | app/Main.hs | bsd-3-clause | 1,023 | 0 | 12 | 214 | 442 | 246 | 196 | 19 | 2 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
-- | This module builds Docker (OpenContainer) images.
... | rvion/stack | src/Stack/Image.hs | bsd-3-clause | 8,426 | 0 | 24 | 2,650 | 1,539 | 789 | 750 | 178 | 2 |
{-# LANGUAGE ViewPatterns #-}
module Run.Test (runTest) where
import Prelude hiding (writeFile, length)
import Data.ByteString.Lazy hiding (putStrLn)
import Data.List hiding (length)
import Data.Maybe
import Control.Monad
import System.Directory
import Test.QuickFuzz.Gen.FormatInfo
import Args
import Debug
impor... | elopez/QuickFuzz | app/Run/Test.hs | gpl-3.0 | 3,314 | 0 | 24 | 1,092 | 768 | 386 | 382 | 60 | 5 |
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
-- | Inquiry to Nirum version.
module Nirum.Version (version, versionString, versionText) where
import Data.Maybe (mapMaybe)
import Data.Version (versionBranch, versionTags)
import qualified Data.SemVer as SV
import Data.Text (Text, pack)
import qualified Paths_nir... | spoqa/nirum | src/Nirum/Version.hs | gpl-3.0 | 1,346 | 0 | 12 | 261 | 325 | 182 | 143 | 27 | 6 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | romanb/amazonka | amazonka-ecs/gen/Network/AWS/ECS/DeregisterTaskDefinition.hs | mpl-2.0 | 4,182 | 0 | 9 | 798 | 453 | 277 | 176 | 58 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Auxilary definitions for 'Semigroup'
--
-- This module provides some @newtype@ wrappers and helpers which are
-- reexported from the "Data.S... | ezyang/ghc | libraries/base/Data/Semigroup/Internal.hs | bsd-3-clause | 7,619 | 0 | 13 | 1,898 | 2,062 | 1,126 | 936 | 130 | 3 |
{-# LANGUAGE Haskell2010 #-}
{-# LINE 1 "System/Process/Common.hs" #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE RecordWildCards #-}
module System.Process.Common
( CreateProcess (..)
, CmdSpec (..)
, StdStream (..)
, ProcessHandle(..)
, ProcessHandle... | phischu/fragnix | tests/packages/scotty/System.Process.Common.hs | bsd-3-clause | 9,966 | 0 | 15 | 3,536 | 1,211 | 710 | 501 | 132 | 2 |
<?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="ko-KR">
<title>Revisit | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref loc... | 0xkasun/security-tools | src/org/zaproxy/zap/extension/revisit/resources/help_ko_KR/helpset_ko_KR.hs | apache-2.0 | 969 | 80 | 66 | 159 | 413 | 209 | 204 | -1 | -1 |
import Graphics.UI.Gtk
main :: IO ()
main = do
initGUI
window <- windowNew
set window [windowTitle := "Paned Window", containerBorderWidth := 10,
windowDefaultWidth := 400, windowDefaultHeight := 400 ]
pw <- vPanedNew
panedSetPosition pw 250
containerAdd window pw
a... | thiagoarrais/gtk2hs | docs/tutorial/Tutorial_Port/Example_Code/GtkChap6-4.hs | lgpl-2.1 | 830 | 0 | 12 | 257 | 246 | 107 | 139 | 25 | 1 |
{-# LANGUAGE TypeOperators, MultiParamTypeClasses, FlexibleInstances #-}
{-# OPTIONS_GHC -Wall #-}
module Mixin where
import Prelude hiding (log)
class a <: b where
up :: a -> b
instance (t1 <: t2) => (t -> t1) <: (t -> t2) where
up f = up . f
instance (t1 <: t2) => (t2 -> t) <: (t1 -> t) where
up f = f . up... | bixuanzju/fcore | lib/Mixin.hs | bsd-2-clause | 1,062 | 0 | 10 | 278 | 541 | 290 | 251 | 30 | 1 |
module Head where
{-@ measure hd :: [a] -> a
hd (x:xs) = x
@-}
-- Strengthened constructors
-- data [a] where
-- [] :: [a] -- as before
-- (:) :: x:a -> xs:[a] -> {v:[a] | hd v = x}
{-@ cons :: x:a -> _ -> {v:[a] | hd v = x} @-}
cons x xs = x : xs
{-@ test :: {v:_ | hd v = 0} @-}
test :: [In... | abakst/liquidhaskell | tests/todo/partialmeasureOld.hs | bsd-3-clause | 356 | 0 | 6 | 118 | 55 | 35 | 20 | 4 | 1 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
module Bug where
import Data.Kind
type HRank1 ty = forall k1. k1 -> ty
type HRank2 ty = forall k2. k2 -> ty
data HREFL11 :: HRank1 (HRank1 Type) -- FAILS
data HREFL12 :: HRank1 (HRank2 Type)
data HREFL21 :: HRank2 (HRank1 Type)
data HR... | sdiehl/ghc | testsuite/tests/polykinds/T14515.hs | bsd-3-clause | 359 | 0 | 7 | 66 | 106 | 63 | 43 | -1 | -1 |
module Main where
import GHC
import MonadUtils
import System.Environment
main :: IO ()
main = do [libdir] <- getArgs
runGhc (Just libdir) doit
doit :: Ghc ()
doit = do
getSessionDynFlags >>= setSessionDynFlags
dyn <- dynCompileExpr "()"
liftIO $ print dyn
| siddhanathan/ghc | testsuite/tests/ghc-api/dynCompileExpr/dynCompileExpr.hs | bsd-3-clause | 278 | 0 | 9 | 63 | 96 | 48 | 48 | 12 | 1 |
{-# LANGUAGE TypeFamilies #-}
module T1897b where
import Control.Monad
import Data.Maybe
class Bug s where
type Depend s
next :: s -> Depend s -> Maybe s
start :: s
-- isValid :: (Bug s) => [Depend s] -> Bool
-- Inferred type should be rejected as ambiguous
isValid ds = isJust $ foldM next start ds
| forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/indexed-types/should_fail/T1897b.hs | bsd-3-clause | 316 | 0 | 9 | 73 | 73 | 40 | 33 | 9 | 1 |
{-# OPTIONS_GHC -fno-safe-infer #-}
-- | Basic test to see if no safe infer flag compiles
-- This module would usually infer safely, so it shouldn't be safe now.
-- We don't actually check that here though, see test '' for that.
module SafeFlags27 where
f :: Int
f = 1
| wxwxwwxxx/ghc | testsuite/tests/safeHaskell/flags/SafeFlags27.hs | bsd-3-clause | 271 | 0 | 4 | 53 | 18 | 13 | 5 | 4 | 1 |
{-# OPTIONS_GHC -Wno-overlapping-patterns -Wno-incomplete-patterns -Wno-incomplete-uni-patterns -Wno-incomplete-record-updates #-}
-- | Index simplification mechanics.
module Futhark.Optimise.Simplify.Rules.Index
( IndexResult (..),
simplifyIndexing,
)
where
import Data.Maybe
import Futhark.Analysis.PrimExp.C... | HIPERFIT/futhark | src/Futhark/Optimise/Simplify/Rules/Index.hs | isc | 10,142 | 0 | 27 | 3,150 | 3,402 | 1,634 | 1,768 | 206 | 31 |
module Extras where
import Data.Char
class Show a => PrettyShow a where
prettyShow :: a -> String
prettyShow x = show x
unique :: Eq a => [a] -> [a]
unique [] = []
unique (x:xs) = if x `elem` xs then unique xs else (x:unique xs)
toLowercase :: String -> String
toLowercase = map toLower
trimLeft :: String -... | fredmorcos/attic | snippets/haskell/QuickCheck/Extras.hs | isc | 538 | 0 | 8 | 118 | 238 | 124 | 114 | 19 | 2 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
-- | This module defines a convenience typeclass for creating
-- normalised programs.
--
-- See "Futhark.Construct" for a high-level description.
module Futhark.Builder.Class
( Buildable (..),
mkLet,
mkLet',
MonadBuilder (..),
insertStms... | HIPERFIT/futhark | src/Futhark/Builder/Class.hs | isc | 5,424 | 0 | 13 | 1,270 | 1,421 | 722 | 699 | -1 | -1 |
-- | Multicore imperative code.
module Futhark.CodeGen.ImpCode.Multicore
( Program,
Function,
FunctionT (Function),
Code,
Multicore (..),
Scheduling (..),
SchedulerInfo (..),
AtomicOp (..),
ParallelTask (..),
module Futhark.CodeGen.ImpCode,
)
where
import Futhark.CodeGen.ImpCode... | HIPERFIT/futhark | src/Futhark/CodeGen/ImpCode/Multicore.hs | isc | 4,250 | 0 | 14 | 932 | 1,286 | 658 | 628 | 96 | 0 |
-- The task is to refactor given functions into more Haskell idiomatic style
------------------------ (1) ----------------------------
-- Before:
fun1 :: [Integer] -> Integer
fun1 [] = 1
fun1 (x:xs)
| even x = (x - 2) * fun1 xs
| otherwise = fun1 xs
-- After:
fun1' :: [Integer] -> Integer
fun1' = product . map ... | vaibhav276/haskell_cs194_assignments | higher_order/Wholemeal.hs | mit | 702 | 3 | 11 | 169 | 272 | 144 | 128 | 16 | 2 |
module Instances where
import Language.Haskell.Syntax
import qualified Language.Haskell.Pretty as P
import Niz
import Data.List
-------------------------------------------------------------------------------
---------------- INSTANCE DECLARATIONS ----------------------------------------
----------------------------... | arnizamani/occam | Instances.hs | mit | 19,725 | 2 | 22 | 5,363 | 9,389 | 4,645 | 4,744 | 450 | 1 |
{-# LANGUAGE OverloadedStrings,NoImplicitPrelude #-}
module TypePlay.Infer.HM where
import Prelude hiding (map,concat)
import Data.List (map,concat,nub,union,intersect)
import Data.Text (Text)
import qualified Data.Text as T
import Data.Monoid ((<>),mconcat)
type Id = Text
enumId :: Int -> Id
enumId = ("v" <>) . T... | mankyKitty/TypePlay | src/TypePlay/Infer/HM.hs | mit | 6,014 | 0 | 13 | 1,814 | 2,536 | 1,299 | 1,237 | 198 | 2 |
import Data.Tree
import Data.Tree.Zipper
import Data.Maybe
import Test.QuickCheck
import System.Random
import Text.Show.Functions
instance Arbitrary a => Arbitrary (Tree a) where
arbitrary = sized arbTree
where
arbTree n = do lbl <- arbitrary
children <- resize (n-1) arbitra... | yav/haskell-zipper | test.hs | mit | 6,455 | 0 | 20 | 1,471 | 2,308 | 1,079 | 1,229 | 147 | 3 |
-- Examples from chapter 5
-- http://learnyouahaskell.com/recursion
maximum' :: (Ord a) => [a] -> a
maximum' [] = error "maximum of empty list"
maximum' [x] = x
maximum' (x:xs) = max x (maximum' xs)
replicate' :: (Num i, Ord i) => i -> a -> [a]
replicate' n x
| n <= 0 = []
| otherwise = x:replicate' (n-1) x
... | Sgoettschkes/learning | haskell/LearnYouAHaskell/05.hs | mit | 902 | 0 | 12 | 232 | 550 | 288 | 262 | 28 | 1 |
module Main (main) where
import System.Console.GetOpt
import System.IO
import System.Environment
import System.Exit
import qualified System.IO as SIO
import Data.ByteString
import Data.Word
import Data.ListLike.CharString
import qualified Data.Iter... | danidiaz/haskell-sandbox | iteratee.hs | mit | 2,218 | 0 | 16 | 676 | 634 | 327 | 307 | 52 | 1 |
-- Primes in numbers
-- http://www.codewars.com/kata/54d512e62a5e54c96200019e/
module Codewars.Kata.PrFactors where
import Data.List (unfoldr, findIndex, group)
import Data.Maybe (fromJust)
prime_factors :: Integer -> String
prime_factors k | isPrime k = "("++ show k ++")"
| otherwise = concatMap g .... | gafiatulin/codewars | src/5 kyu/PrFactors.hs | mit | 1,095 | 0 | 16 | 352 | 506 | 277 | 229 | 17 | 4 |
module Main where
import Synonyms
import Test.Hspec
main :: IO ()
main = hspec $ do
let d = Definition "foo" ["b"] in
describe "lookupDefinition" $ do
it "returns Nothing when no matches" $
lookupDefinition "a" [d] `shouldBe` Nothing
it "returns Just Definition whe... | justincampbell/synonyms | Spec.hs | mit | 720 | 0 | 16 | 210 | 191 | 96 | 95 | 17 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Simulation.Node.Service.Http
( HttpService
, Service
, Routes (..)
, activate
, as
, toSnapRoutes
, selfStore
, basePrefix
, module Snap.Core
) where
import Control.Applicative (Applicative, Alterna... | kosmoskatten/programmable-endpoint | src/Simulation/Node/Service/Http.hs | mit | 3,288 | 0 | 13 | 673 | 695 | 401 | 294 | 59 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
module Alder.Html.Internal
( -- * Elements
Node(..)
-- * Attributes
, Id
, Handlers
, Attributes(..)
, defaultAttributes
-- * Html
, Html
, HtmlM(..)
, runHtml
, parent
, lea... | ghcjs/ghcjs-sodium | src/Alder/Html/Internal.hs | mit | 4,281 | 0 | 11 | 1,225 | 1,538 | 846 | 692 | 141 | 2 |
module Main where
data MyBool = MyTrue | MyFalse
foo a MyFalse b = 0
foo c MyTrue d = 1
bar a = 2
main_ = foo 1 MyFalse 2
| Ekleog/hasklate | examples/BasicPatternMatching.hs | mit | 126 | 0 | 5 | 35 | 58 | 31 | 27 | 6 | 1 |
{-# LANGUAGE CPP, TypeFamilies, DeriveDataTypeable #-}
module PGIP.GraphQL.Result.LocIdReference where
import Data.Data
newtype LocIdReference = LocIdReference { locId :: String
} deriving (Show, Typeable, Data)
| spechub/Hets | PGIP/GraphQL/Result/LocIdReference.hs | gpl-2.0 | 255 | 0 | 6 | 67 | 42 | 27 | 15 | 5 | 0 |
{-# LANGUAGE Arrows #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RecursiveDo #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Main (main) where
import Control.Lens
import Control.Monad.State
import Control.Wire
import... | Taneb/LD29 | src/Main.hs | gpl-2.0 | 7,122 | 3 | 21 | 1,874 | 2,890 | 1,500 | 1,390 | -1 | -1 |
{-| Scan clusters via RAPI or LUXI and write state data files.
-}
{-
Copyright (C) 2009, 2010, 2011 Google Inc.
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
... | ekohl/ganeti | htools/hscan.hs | gpl-2.0 | 4,879 | 0 | 15 | 1,240 | 1,181 | 608 | 573 | 105 | 2 |
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable, FlexibleContexts, MultiParamTypeClasses, FlexibleInstances, UndecidableInstances, TypeSynonymInstances, ScopedTypeVariables #-}
module Turing.Type
( module Turing.Type
, module Autolib.Set
, module Autolib.FiniteMap
)
where
-- $Id$
import Autolib.Set
import Auto... | Erdwolf/autotool-bonn | src/Turing/Type.hs | gpl-2.0 | 2,844 | 39 | 10 | 769 | 1,063 | 606 | 457 | -1 | -1 |
module Main where
import System.Environment(getArgs)
nonRepeatedChar :: [Char] -> Char
nonRepeatedChar = nonRepeatedChar' []
where nonRepeatedChar' xs (c:cs) =
if c `notElem` cs && c `notElem` xs then c
else nonRepeatedChar' (c:xs) cs
processLine :: String -> String
processLine line = [ n... | cryptica/CodeEval | Challenges/12_FirstNonRepeatingCharacter/main.hs | gpl-3.0 | 478 | 0 | 10 | 112 | 169 | 89 | 80 | 14 | 2 |
module WebParsing.PostParser
(addPostToDatabase) where
import qualified Data.Text as T
import Data.Either (fromRight)
import Data.Maybe (maybe)
import Data.List (find)
import Data.Text (strip)
import Control.Monad.Trans (liftIO)
import Text.HTML.TagSoup
import Text.HTML.TagSoup.Match
import Data.List.Split (split,... | christinem/courseography | app/WebParsing/PostParser.hs | gpl-3.0 | 4,147 | 0 | 18 | 1,072 | 1,190 | 618 | 572 | 84 | 3 |
{- To ensure GHC evalutes attributes the right number of times we disable the CSE optimisation -}
{-# OPTIONS_GHC -fno-cse #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Data.Config.Args
( Args(..)
, defArgs
, etcConfig
) where
import System.Console.CmdArgs
newtype Args = Args { configPath :: Maybe String
... | retep007/security-log | src/Data/Config/Args.hs | gpl-3.0 | 483 | 0 | 7 | 94 | 90 | 57 | 33 | 13 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Response.Loading
(loadingResponse) where
import Text.Blaze ((!))
import qualified Text.Blaze.Html5 as H
import qualified Text.Blaze.Html5.Attributes as A
import Happstack.Server
import MasterTemplate
loadingResponse :: String -> ServerPart Response
loadingRespo... | Ian-Stewart-Binks/courseography | hs/Response/Loading.hs | gpl-3.0 | 1,275 | 0 | 12 | 380 | 280 | 145 | 135 | 27 | 2 |
{- ORMOLU_DISABLE -}
-- Example 13 - the rounded union of a cube and a sphere.
import Control.Applicative (pure)
import Graphics.Implicit
out = union [
cube False (pure 20) -- same as (V3 20 20 20)
, translate (pure 20) $ sphere 15
]
main = writeSTL 1 "example13.stl" out
| colah/ImplicitCAD | Examples/example13.hs | agpl-3.0 | 282 | 0 | 10 | 60 | 72 | 38 | 34 | 6 | 1 |
-- different ways to generate primes
ps :: Int -> [Int]
ps 2 = [2]
ps n =
let pn1 = ps (n-1) in
if any (==0) $ map (rem n) pn1
then pn1
else pn1 ++ [n]
isqrt :: Integral a => a -> a
isqrt = ceiling . sqrt . fromIntegral
ispm :: Int -> Bool
ispm 1 = True
ispm 2 = True
ispm n = null [q | q <- [x | x <-... | ekalosak/haskell-practice | Primes.hs | lgpl-3.0 | 360 | 0 | 14 | 106 | 209 | 108 | 101 | 13 | 2 |
-- http://stackoverflow.com/questions/20849893/how-to-plot-a-graph-using-haskell-graphviz
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-
Created : 2014 Feb 26 (Wed) 18:54:30 by Harold Carr.
Last Modified : 2014 Feb 28 (Fri) 17:10:45 by Har... | haroldcarr/learn-haskell-coq-ml-etc | haskell/paper/haroldcarr/2014-02-28-using-graphviz-via-haskell/e1.hs | unlicense | 1,767 | 0 | 10 | 413 | 556 | 316 | 240 | 33 | 1 |
type CardHolder = String
type CardNumber = String
type Address = [String]
type CustomerID = Int
data BillingInfo = CreditCard CardNumber CardHolder Address
| CashOnDelivery
| Invoice CustomerID
deriving (Show)
| caiorss/Functional-Programming | haskell/rwh/ch03/BookStore2.hs | unlicense | 265 | 0 | 6 | 85 | 56 | 34 | 22 | 8 | 0 |
module Propellor.Property.Tor where
import Propellor
import qualified Propellor.Property.File as File
import qualified Propellor.Property.Apt as Apt
import qualified Propellor.Property.Service as Service
import Utility.FileMode
import Utility.DataUnits
import System.Posix.Files
import Data.Char
import Data.List
type... | sjfloat/propellor | src/Propellor/Property/Tor.hs | bsd-2-clause | 5,177 | 64 | 16 | 908 | 1,510 | 818 | 692 | 113 | 2 |
{-# LANGUAGE TypeFamilies, OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Xournal.Map
-- Copyright : (c) 2011, 2012 Ian-Woo Kim
--
-- License : BSD3
-- Maintainer : Ian-Woo Kim <[email protected]>
-- Stability : experimental
--... | wavewave/xournal-types | src/Data/Xournal/Map.hs | bsd-2-clause | 875 | 0 | 7 | 133 | 143 | 86 | 57 | 14 | 1 |
module Interface.LpSolve where
-- standard modules
-- local modules
import Helpful.Process
--import Data.Time.Clock (diffUTCTime, getCurrentTime)
--import Debug.Trace
zeroObjective :: String -> Maybe Bool
zeroObjective p = case head answer of
"This problem is infeasible" -> Nothing
"This problem is unbounde... | spatial-reasoning/zeno | src/Interface/LpSolve.hs | bsd-2-clause | 1,952 | 0 | 15 | 602 | 196 | 113 | 83 | 17 | 5 |
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances #-}
module Lambda.DataType.SExpr where
import DeepControl.Applicative
import DeepControl.Monad
import Lambda.DataType.Common
import Lambda.DataType.PatternMatch (PM)
import qualified Lambda.DataType.PatternMatch as PM
import Lambda.DataType.Type (Type((:->)))
i... | ocean0yohsuke/Simply-Typed-Lambda | src/Lambda/DataType/SExpr.hs | bsd-3-clause | 6,954 | 2 | 14 | 2,660 | 2,742 | 1,427 | 1,315 | 140 | 1 |
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
-- | Model for wiki.
module HL.Model.Wiki where
import HL.Controller
import Control.Exception.Lifted (catch)
import Control.Spoon
import Data.Conduit
import Data.Maybe
import Da... | erantapaa/hl | src/HL/Model/Wiki.hs | bsd-3-clause | 2,701 | 0 | 22 | 816 | 675 | 348 | 327 | 71 | 2 |
{-# LANGUAGE CPP #-}
#include "overlapping-compat.h"
module Servant.ForeignSpec where
import Data.Monoid ((<>))
import Data.Proxy
import Servant.Foreign
import Test.Hspec
spec :: Spec
spec = describe "Servant.Foreign" $ do
camelCaseSpec
listFromAPISpec
camelCaseSpec :: Spec
camelCaseSpec = descri... | zerobuzz/servant | servant-foreign/test/Servant/ForeignSpec.hs | bsd-3-clause | 4,035 | 0 | 24 | 1,120 | 1,148 | 604 | 544 | -1 | -1 |
{-
(c) The University of Glasgow 2011
The deriving code for the Generic class
(equivalent to the code in TcGenDeriv, for other classes)
-}
{-# LANGUAGE CPP, ScopedTypeVariables, TupleSections #-}
{-# LANGUAGE FlexibleContexts #-}
module TcGenGenerics (canDoGenerics, canDoGenerics1,
GenericKind... | ghc-android/ghc | compiler/typecheck/TcGenGenerics.hs | bsd-3-clause | 37,323 | 0 | 23 | 11,947 | 7,328 | 3,905 | 3,423 | 496 | 6 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
{-# LANGUAGE Over... | rfranek/duckling | Duckling/Email/EN/Corpus.hs | bsd-3-clause | 983 | 0 | 9 | 246 | 140 | 84 | 56 | 19 | 1 |
module SimpleLang.Syntax where
import Data.Functor.Identity
import Data.Maybe (fromMaybe)
import qualified SimpleLang.Parser as P
import Text.Parsec
import qualified Text.Parsec.Expr as Ex
import qualified Text.Parsec.Token as Tok
data Expr =
Tr
| Fl
|... | AlphaMarc/WYAH | src/SimpleLang/Syntax.hs | bsd-3-clause | 2,692 | 0 | 11 | 856 | 909 | 451 | 458 | 82 | 11 |
{-# LANGUAGE OverloadedStrings, TemplateHaskell #-}
module Config where
import Control.Applicative
import Control.Exception
import Data.ByteString (ByteString)
import Data.Configurator as C
import HFlags
import System.Directory
import System.FilePath
import System.IO
import Paths_sproxy_web
defineFlag "c:config" ("... | alpmestan/spw | src/Config.hs | bsd-3-clause | 1,432 | 0 | 13 | 332 | 291 | 152 | 139 | 38 | 3 |
module Module1.Task10 where
fibonacci :: Integer -> Integer
fibonacci n
| n == 0 = 0
| n == 1 = 1
| n < 0 = -(-1) ^ (-n) * fibonacci (-n)
| n > 0 = fibonacciIter 0 1 (n - 2)
fibonacciIter acc1 acc2 0 = acc1 + acc2
fibonacciIter acc1 acc2 n =
fibonacciIter (acc2) (acc1 + acc2) (n - 1)
| dstarcev/stepic-haskell | src/Module1/Task10.hs | bsd-3-clause | 309 | 0 | 10 | 89 | 166 | 84 | 82 | 10 | 1 |
{-# LANGUAGE BangPatterns #-}
module Network.HPACK.Table.DoubleHashMap (
DoubleHashMap
, empty
, insert
, delete
, fromList
, deleteList
, Res(..)
, search
) where
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as H
import Data.List (foldl')
import Network.HPACK.Types
n... | bergmark/http2 | Network/HPACK/Table/DoubleHashMap.hs | bsd-3-clause | 2,210 | 0 | 14 | 597 | 774 | 392 | 382 | 51 | 4 |
{-# LANGUAGE OverloadedStrings #-}
module Network.IRC.Bot.Part.Channels where
import Control.Concurrent.STM (atomically)
import Control.Concurrent.STM.TVar (TVar, newTVar, readTVar, writeTVar)
import Control.Monad.Trans (MonadIO(liftIO))
import Data.Monoid ((<>))
import Data.Set (Set, insert, toList)
import Data.ByteS... | eigengrau/haskell-ircbot | Network/IRC/Bot/Part/Channels.hs | bsd-3-clause | 1,451 | 0 | 14 | 322 | 505 | 267 | 238 | 34 | 2 |
{-# LANGUAGE MultiParamTypeClasses #-}
-- |
-- Module: $HEADER$
-- Description: Command line tool that generates random passwords.
-- Copyright: (c) 2013 Peter Trsko
-- License: BSD3
--
-- Maintainer: [email protected]
-- Stability: experimental
-- Portability: non-portable (FlexibleContexts, d... | trskop/hpwgen | src/Main/Application.hs | bsd-3-clause | 11,354 | 0 | 14 | 2,715 | 2,637 | 1,443 | 1,194 | 218 | 4 |
{-# LANGUAGE ViewPatterns #-}
module Plunge.Analytics.C2CPP
( lineAssociations
) where
import Data.List
import Plunge.Types.PreprocessorOutput
-- Fill in any gaps left by making associations out of CPP spans.
lineAssociations :: [Section] -> [LineAssociation]
lineAssociations ss = concat $ snd $ mapAccumL fillGap... | sw17ch/plunge | src/Plunge/Analytics/C2CPP.hs | bsd-3-clause | 1,653 | 0 | 14 | 546 | 509 | 275 | 234 | 29 | 4 |
{-# LANGUAGE GADTs, TypeOperators #-}
module Compiler.InstantiateLambdas (instantiate, dump) where
import Compiler.Generics
import Compiler.Expression
import Control.Applicative
import Control.Arrow hiding (app)
import Control.Monad.Reader
import Data.List (intercalate)
import qualified Lang.Value as V
instantiate ... | tomlokhorst/AwesomePrelude | src/Compiler/InstantiateLambdas.hs | bsd-3-clause | 1,251 | 0 | 19 | 341 | 608 | 309 | 299 | -1 | -1 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
import Db
import Parser
import Trains
import Result
import Data.List
import System.IO
import System.Directory
import Control.Arrow
import Control.Applicative
import ... | fadeopolis/prog-spr-ue3 | ue3.hs | bsd-3-clause | 11,533 | 26 | 25 | 2,963 | 2,914 | 1,473 | 1,441 | 193 | 3 |
a :: Int
a = 123
unittest "quote" [
(show {a}, "a"),
(show {,a}, ",a"),
(show {pred ,a}, "pred ,a"),
]
unittest "quasiquote" [
(`a, a),
(`(,a), 123),
(`(pred ,a), pred 123),
(let x = `(pred ,a) in x , 122... | ocean0yohsuke/Simply-Typed-Lambda | Start/UnitTest/Quote.hs | bsd-3-clause | 650 | 23 | 11 | 247 | 320 | 195 | 125 | -1 | -1 |
module Test.Pos.Crypto.Gen
(
-- Protocol Magic Generator
genProtocolMagic
, genProtocolMagicId
, genRequiresNetworkMagic
-- Sign Tag Generator
, genSignTag
-- Key Generators
, genKeypair
, genPublicKey
, genSecretKey
, g... | input-output-hk/pos-haskell-prototype | crypto/test/Test/Pos/Crypto/Gen.hs | mit | 11,486 | 0 | 13 | 2,478 | 2,303 | 1,249 | 1,054 | 220 | 2 |
{-
--Task 4
--power x*y =
--if x*y==0
--then 0
--else if (x*y) != 0
--then x+(x*(y-1))
--These are home tasks
--bb bmi
--| bmi <= 10 ="a"
--| bmi <= 5 = "b"
--| otherwise = bmi
slope (x1,y1) (x2,y2) = dy / dx
where dy = y2-y1
dx = x2 - x1
--Task 2
reci x = 1/x;
--Task 3
--abst x
--Task 4
sign x
| x<0 = ... | badarshahzad/Learn-Haskell | week 2 & 3/function.hs | mit | 974 | 0 | 2 | 266 | 3 | 2 | 1 | 1 | 0 |
{- |
Module : ./HasCASL/Builtin.hs
Description : builtin types and functions
Copyright : (c) Christian Maeder and Uni Bremen 2003
License : GPLv2 or higher, see LICENSE.txt
Maintainer : [email protected]
Stability : experimental
Portability : portable
HasCASL's builtin types and functions
... | spechub/Hets | HasCASL/Builtin.hs | gpl-2.0 | 10,052 | 0 | 20 | 2,343 | 3,284 | 1,800 | 1,484 | 265 | 3 |
{- |
Module : ./CASL_DL/Parse_AS.hs
Description : Parser for CASL_DL
Copyright : (c) Klaus Luettich, Uni Bremen 2004
License : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
Maintainer : [email protected]
Stability : provisional
Portability : portable
Parser for CASL_DL lo... | spechub/Hets | CASL_DL/Parse_AS.hs | gpl-2.0 | 1,535 | 0 | 13 | 348 | 359 | 179 | 180 | 37 | 1 |
-- grid is a game written in Haskell
-- Copyright (C) 2018 [email protected]
--
-- This file is part of grid.
--
-- grid 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 Lice... | karamellpelle/grid | source/MEnv/System.hs | gpl-3.0 | 1,023 | 0 | 5 | 180 | 61 | 50 | 11 | 2 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | kim/amazonka | amazonka-workspaces/gen/Network/AWS/WorkSpaces/CreateWorkspaces.hs | mpl-2.0 | 4,636 | 0 | 13 | 920 | 571 | 343 | 228 | 66 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | fmapfmapfmap/amazonka | amazonka-sns/gen/Network/AWS/SNS/ListTopics.hs | mpl-2.0 | 4,692 | 0 | 16 | 1,104 | 745 | 437 | 308 | 86 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | romanb/amazonka | amazonka-ecs/gen/Network/AWS/ECS/ListServices.hs | mpl-2.0 | 5,564 | 0 | 12 | 1,164 | 688 | 415 | 273 | 73 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE TupleSections #-}
#if MIN_VERS... | Gabriel439/succinct | src/Succinct/Sequence.hs | bsd-2-clause | 19,162 | 0 | 24 | 5,073 | 6,196 | 3,268 | 2,928 | 274 | 33 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RecordWildCards #-}
-- | Run sub-processes.
module System.Process.Run
(run... | Heather/stack | src/System/Process/Run.hs | bsd-3-clause | 4,928 | 0 | 18 | 1,369 | 1,079 | 588 | 491 | 100 | 3 |
{-# LANGUAGE Rank2Types #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Choose.ST
-- Copyright : Copyright (c) , Patrick Perry <[email protected]>
-- License : BSD3
-- Maintainer : Patrick Perry <[email protected]>
-- Stability : experimental
--
-... | patperry/permutation | lib/Data/Choose/ST.hs | bsd-3-clause | 1,074 | 0 | 10 | 185 | 114 | 75 | 39 | 11 | 1 |
{-# LANGUAGE CPP #-}
module Main where
import Prelude hiding ( catch )
import Test.HUnit
import System.Exit
import System.Process ( system )
import System.IO ( stderr )
import qualified DependencyTest
import qualified MigrationsTest
import qualified FilesystemSerializeTest
import qualified FilesystemParseTest
import ... | nick0x01/dbmigrations | test/TestDriver.hs | bsd-3-clause | 3,047 | 0 | 15 | 771 | 701 | 377 | 324 | -1 | -1 |
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable #-}
module Graph.MST.Config where
import Autolib.ToDoc
import Autolib.Reader
import Data.Typeable
data Config = Config
{ nodes :: Int
, edges :: Int
, weight_bounds :: (Int,Int)
}
deriving ( Typeable )
$(derives [makeReader, mak... | Erdwolf/autotool-bonn | src/Graph/MST/Config.hs | gpl-2.0 | 450 | 12 | 14 | 132 | 121 | 74 | 47 | 15 | 1 |
module Graphics.UI.Gtk.Layout.EitherWidget where
import Control.Monad
import Data.IORef
import Graphics.UI.Gtk
import System.Glib.Types
data EitherWidget a b = EitherWidget Notebook (IORef EitherWidgetParams)
type EitherWidgetParams = Bool
instance WidgetClass (EitherWidget a b)
instance ObjectClass (EitherWidget ... | keera-studios/gtk-helpers | gtk3/src/Graphics/UI/Gtk/Layout/EitherWidget.hs | bsd-3-clause | 1,612 | 0 | 15 | 377 | 495 | 243 | 252 | 34 | 2 |
module E.Binary() where
import Data.Binary
import E.Type
import FrontEnd.HsSyn()
import Name.Binary()
import Support.MapBinaryInstance
import {-# SOURCE #-} Info.Binary(putInfo,getInfo)
instance Binary TVr where
put TVr { tvrIdent = eid, tvrType = e, tvrInfo = nf} = do
put eid
put e
putIn... | m-alvarez/jhc | src/E/Binary.hs | mit | 5,542 | 58 | 44 | 1,865 | 2,102 | 1,018 | 1,084 | -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="hu-HU">
<title>Directory List v2.3</title>
<maps>
<homeID>directorylistv2_3</homeID>
<m... | thc202/zap-extensions | addOns/directorylistv2_3/src/main/javahelp/help_hu_HU/helpset_hu_HU.hs | apache-2.0 | 978 | 78 | 66 | 157 | 412 | 209 | 203 | -1 | -1 |
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
----------------------------------------------------------------------------
-- |
-- Module : XMonad.Layout.NoFrillsDecoration
-- Copyright : (c) Jan Vornberger 2009
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : jan.vornberger@informat... | pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Layout/NoFrillsDecoration.hs | bsd-2-clause | 1,703 | 0 | 11 | 292 | 184 | 114 | 70 | 14 | 1 |
{-# LANGUAGE TypeFamilies, TypeSynonymInstances, FlexibleContexts, FlexibleInstances, ScopedTypeVariables, Arrows, GeneralizedNewtypeDeriving, PatternSynonyms #-}
module Graphics.GPipe.Internal.PrimitiveStream where
import Control.Monad.Trans.Class
import Control.Monad.Trans.Writer.Lazy
import Control.Monad.Trans.Sta... | Teaspot-Studio/GPipe-Core | src/Graphics/GPipe/Internal/PrimitiveStream.hs | mit | 22,384 | 13 | 18 | 6,885 | 7,189 | 3,654 | 3,535 | 325 | 10 |
module ASPico.Handler.Root.Affiliate
( ApiAffiliate
, serverAffiliate
) where
import ASPico.Prelude hiding (product)
import Database.Persist.Sql (Entity(..), fromSqlKey)
import Servant ((:>), FormUrlEncoded, JSON, Post, ReqBody, ServerT)
import ASPico.Envelope (Envelope, returnSuccess)
import ASPico.Error (App... | arowM/ASPico | src/ASPico/Handler/Root/Affiliate.hs | mit | 905 | 0 | 10 | 124 | 282 | 162 | 120 | -1 | -1 |
module StackLang where
import Prelude hiding (EQ,If)
-- Grammar for StackLang:
--
-- num ::= (any number)
-- bool ::= `true` | `false`
-- prog ::= cmd*
-- cmd ::= int push a number on the stack
-- | bool push a boolean on the stack
-- | `add` ad... | siphayne/CS381 | scratch/StackLang.hs | mit | 1,454 | 0 | 8 | 453 | 243 | 145 | 98 | 17 | 1 |
module Utils where
import Import hiding (group)
import Data.Char (isSpace)
import Data.Conduit.Binary (sinkLbs)
import qualified Data.ByteString.Lazy.Char8 as LB8
import qualified Data.HashMap.Strict as M
import qualified Data.List as L
-- import ... | ranjitjhala/gradr | Utils.hs | mit | 1,752 | 0 | 11 | 463 | 803 | 429 | 374 | 38 | 1 |
-- | Specification for the exercises of Chapter 6.
module Chapter06Spec where
import qualified Chapter06 as C6
import Data.List (sort)
import Data.Proxy
import Test.Hspec (Spec, describe, it, shouldBe)
import Test.QuickCheck (Arbitrary (..), Property, property... | EindhovenHaskellMeetup/meetup | courses/programming-in-haskell/pih-exercises/test/Chapter06Spec.hs | mit | 5,372 | 0 | 20 | 1,581 | 1,730 | 903 | 827 | 100 | 1 |
module ProjectEuler.Problem004 (solve) where
isPalindrome :: Integer -> Bool
isPalindrome n = reverse xs == xs
where
xs = show n
nDigitIntegers :: Integer -> [Integer]
nDigitIntegers n = [10^(n-1)..(10^n)-1]
solve :: Integer -> Integer
solve n = maximum $ filter isPalindrome xs
where
xs = [a * b | a <- y... | hachibu/project-euler | src/ProjectEuler/Problem004.hs | mit | 358 | 0 | 9 | 79 | 156 | 83 | 73 | 10 | 1 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | This module introduces functions that allow to run action in parallel with logging.
module System.Wlog.Concurrent
( WaitingDelta (..)
, CanLogInParalle... | serokell/log-warper | src/System/Wlog/Concurrent.hs | mit | 4,062 | 0 | 16 | 990 | 781 | 421 | 360 | 57 | 3 |
{-# htermination negate :: Float -> Float #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_negate_3.hs | mit | 46 | 0 | 2 | 8 | 3 | 2 | 1 | 1 | 0 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module SchoolOfHaskell.Scheduler.API where
import Control.Applicative ((<$>), (<*>))
import Control.Lens (makeLenses)
import Data.Aeson (ToJSON(..), FromJSON(..))
import ... | fpco/schoolofhaskell | soh-scheduler-api/src/SchoolOfHaskell/Scheduler/API.hs | mit | 2,070 | 0 | 16 | 418 | 573 | 330 | 243 | 47 | 1 |
length' [] = 0
length' (x:xs) = 1 + (length' xs)
append' [] = id
append' (x:xs) = (x:).append' xs
-- A trivial way
reverse' [] = []
reverse' (x:xs) = (reverse' xs) ++ [x]
reverse2 = rev [] where
rev a [] = a
rev a (x:xs) = rev (x:a) xs
fix f = f (fix f)
reverse3 = fix (\ f a x -> case x of
... | MaKToff/SPbSU_Homeworks | Semester 3/Classwork/cw01.hs | mit | 760 | 0 | 13 | 234 | 542 | 279 | 263 | 26 | 2 |
szachy is xD
mialo byc warcaby xD
w erlangu zrobic strange sort itp.. wszysstko to co w haskelu | RAFIRAF/HASKELL | CHESS2016.hs | mit | 97 | 2 | 5 | 19 | 44 | 19 | 25 | -1 | -1 |
{-
******************************************************************************
* JSHOP *
* *
* Module: ParseMonad *
*... | nbrunt/JSHOP | src/old/ver2/ParseMonad.hs | mit | 4,096 | 0 | 10 | 1,645 | 226 | 139 | 87 | 34 | 1 |
-----------------------------------------------------------------------------
--
-- Module : Topology
-- Copyright :
-- License : AllRightsReserved
--
-- Maintainer :
-- Stability :
-- Portability :
--
-- |
--
-----------------------------------------------------------------------------
module Topology... | uvNikita/TopologyRouting | src/Topology.hs | mit | 1,494 | 0 | 10 | 423 | 505 | 279 | 226 | 32 | 2 |
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances #-}
{- |
Module : $Header$
Description : embedding from CASL to VSE, plus wrapping procedures
with default implementations
Copyright : (c) M.Codescu, DFKI Bremen 2008
License : GPLv2 or higher, see LICENSE.txt
Mai... | nevrenato/Hets_Fork | Comorphisms/CASL2VSEImport.hs | gpl-2.0 | 7,891 | 0 | 46 | 3,564 | 1,813 | 950 | 863 | 164 | 2 |
predecessor = predecessor
successor :: Bool
successor = successor
| evolutics/haskell-formatter | testsuite/resources/source/comments/empty_lines/between_top_level_functions/with_type_signature/0/Input.hs | gpl-3.0 | 66 | 0 | 4 | 9 | 16 | 9 | 7 | 3 | 1 |
import System.IO
import System.Environment(getArgs)
import System.Process
import qualified Data.ByteString.Char8 as Byte
import Control.Concurrent
import System.Exit
import System.Directory(removeFile)
first :: [a] -> a
first (x:xs) = x
give :: Byte.ByteString -> [[String]]
give file = map (map (Byte.unpack)) $ fmap... | prannayk/conj | vader.hs | gpl-3.0 | 840 | 0 | 14 | 148 | 363 | 187 | 176 | 25 | 1 |
data Cont r a = Cont ((a -> r) -> r) | hmemcpy/milewski-ctfp-pdf | src/content/3.5/code/haskell/snippet23.hs | gpl-3.0 | 36 | 0 | 10 | 10 | 26 | 15 | 11 | 1 | 0 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
{-# LANGUAGE CPP, DeriveDataTypeable, ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types]
... | shayan-najd/HsParser | Language/Haskell/Syntax/HsExpr.hs | gpl-3.0 | 39,089 | 0 | 12 | 11,831 | 3,151 | 1,962 | 1,189 | 306 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.