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 Test.HUnit (Assertion, (@=?), runTestTT, Test(..))
import Control.Monad (void)
import LeapYear (isLeapYear)
testCase :: String -> Assertion -> Test
testCase label assertion = TestLabel label (TestCase assertion)
main :: IO ()
main = void $ runTestTT $ TestList
[ TestList isLeapYearTests ]
isLeapYearTes... | tfausak/exercism-solutions | haskell/leap/leap_test.hs | mit | 599 | 0 | 8 | 120 | 191 | 101 | 90 | 18 | 1 |
merge xs [] = xs
merge [] ys = ys
merge (x:xs) (y:ys)
| x < y = x : merge xs (y:ys)
| otherwise = y : merge (x:xs) ys
msort [] = []
msort [x] = [x]
msort xs = merge (msort (take h xs)) (msort (drop h xs))
where
h = (length xs) `div` 2
main = do
print $ msort [4, 6, 9, 8, 3, 5, 1, 7, 2]
| shigemk2/haskell_abc | merge.hs | mit | 315 | 0 | 9 | 101 | 228 | 119 | 109 | 11 | 1 |
-- list in haskell.
--
-- 1. list is homogenous. [a]
--
-- 2. string is a list of characters
-- "abc" == ['a', 'b', 'c']
--
-- 3. basic operations
-- ++ concat [1, 2] ++ [3, 4] = [1, 2, 3, 4]
-- : 1:2:[3] = [1, 2, 3]
-- !! get item [1, 2, 3] !! 2 = 3
-- == > < compare by order
-... | ddki/my_study_project | language/haskell/grammer/base/list.hs | mit | 2,644 | 0 | 47 | 807 | 1,082 | 627 | 455 | 42 | 1 |
module Chess.MoveSpec (spec) where
import Test.Hspec
import Control.Monad (liftM)
import Data.Maybe (fromJust, isJust, isNothing)
import Chess.Board
import Chess.Move
import Chess.Game
blackGame :: Game
blackGame = newGame { player = Black }
whiteGame :: Game
whiteGame = newGame { player = White }
spec :: Spec
sp... | samgd/Chess | test/Chess/MoveSpec.hs | mit | 13,801 | 0 | 23 | 5,719 | 4,270 | 2,294 | 1,976 | 242 | 14 |
module CodeModel.Module where
import CodeModel.Core
import CodeModel.Interface
data Import = Import String
data Module = Module String [Import] [Interface] [Core] [Trait]
instance Show Import where
show (Import s) = "import " ++ s
instance Show Module where
show (Module n ims ins cs ts) = "module " ++ n ++... | MarcusVoelker/Recolang | CodeModel/Module.hs | mit | 439 | 0 | 13 | 87 | 182 | 94 | 88 | 9 | 0 |
{-# OPTIONS
-XMultiParamTypeClasses
-XFunctionalDependencies
-XMultiWayIf
-XFlexibleInstances
-XFlexibleContexts
#-}
module Search (Treelike, children, root, graft, SearchPath, TPath, TPath2, path, meTree, cur, curTree, up, down, prev, next, start, changeMe, emptyPath, node, dFSStep, dFSStep2, zipUp) where
impo... | holdenlee/fluidity | SeekWhence/formulas/Search.hs | mit | 6,172 | 0 | 20 | 2,498 | 2,208 | 1,169 | 1,039 | -1 | -1 |
module Zwerg.Generator.Item.Weapon (sword) where
import Zwerg.Generator
import Zwerg.Generator.Default
sword :: Generator
sword = Generator swordHatch []
swordHatch :: EntityHatcher
swordHatch = MkEntityHatcher $ do
swordUUID <- generateSkeleton Item
let (<@-) :: Component a -> a -> MonadCompState ()
... | zmeadows/zwerg | lib/Zwerg/Generator/Item/Weapon.hs | mit | 716 | 0 | 14 | 163 | 200 | 99 | 101 | 17 | 1 |
{- ORMOLU_DISABLE -}
{-
Disable formatting this comment so that fourmolu doesn't complain about
qualified do in the example code.
-}
{- |
Module : Orville.PostgreSQL.Connection
Copyright : Flipstone Technology Partners 2021
License : MIT
This module exports the 'Plan.bind' function as '>>=' so that it can be ... | flipstone/orville | orville-postgresql-libpq/src/Orville/PostgreSQL/Plan/Syntax.hs | mit | 1,320 | 0 | 10 | 251 | 103 | 63 | 40 | 9 | 1 |
module Holyhaskell.Coconut (coconut,coconutfunc,CoconutDataStruct(..)) where
data CoconutDataStruct = CoconutConstr [Integer] deriving (Show)
coconut :: Integer
coconut = 10
coconutfunc :: CoconutDataStruct -> Int
coconutfunc (CoconutConstr l) = length l
| duikboot/holyhaskell | src/Holyhaskell/Coconut.hs | mit | 257 | 0 | 7 | 30 | 76 | 44 | 32 | 6 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TemplateHaskell #-}
module Data.FreeAgent.Types.Projects where
import qualified Data.ByteString as BS
import Control.Applicative ((<$>), (<*>), empty)
import Control.Lens
import Data.Aeson
import ... | perurbis/hfreeagent | src/Data/FreeAgent/Types/Projects.hs | mit | 1,975 | 0 | 31 | 811 | 361 | 211 | 150 | 44 | 0 |
module Chapter07.Chapter7 where
numbers :: (Num a, Ord a) => a -> Integer
numbers x
| x < 0 = -1
| x == 0 = 0
| x > 0 = 1
pal :: [Char] -> Bool
pal xs
| xs == reverse xs = True
| otherwise = False
avgGrade :: (Fractional a, Ord a) => a -> Char
avgGrade x
| y >= 0.9 = 'A... | brodyberg/LearnHaskell | HaskellProgramming.hsproj/Chapter07/Chapter7.hs | mit | 1,446 | 0 | 9 | 621 | 811 | 422 | 389 | 61 | 3 |
{-# LANGUAGE GeneralizedNewtypeDeriving, DataKinds #-}
{-# LANGUAGE UndecidableInstances, FlexibleInstances, FlexibleContexts #-}
{-# LANGUAGE TypeOperators, DefaultSignatures, ScopedTypeVariables, CPP #-}
#if MIN_VERSION_base(4, 10, 0)
{-# OPTIONS_GHC -Wno-simplifiable-class-constraints #-}
#endif
module Database.Seld... | valderman/selda | selda/src/Database/Selda/SqlRow.hs | mit | 3,056 | 0 | 15 | 668 | 1,126 | 624 | 502 | 78 | 1 |
-- | Pretty printing functionality.
module Galua.Pretty
( module Text.PrettyPrint
, module Galua.Pretty
) where
import Text.PrettyPrint
class Pretty t where
pp :: t -> Doc
instance Pretty Doc where
pp = id
| GaloisInc/galua | galua-rts/src/Galua/Pretty.hs | mit | 220 | 0 | 7 | 47 | 57 | 33 | 24 | 8 | 0 |
main = do
putStrLn "Hello, World!" | brodyberg/Notes | csv/csv1/src/Main.hs | mit | 37 | 0 | 7 | 8 | 12 | 5 | 7 | 2 | 1 |
{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
module Main where
import System.Environment (getArgs)
import System.Locale (defaultTimeLocale)
import Data.Time (parseTime, getCurrentTimeZone, utcToZonedTime)
import Data.ByteString ... | krdlab/hs-twitter-client | Main.hs | mit | 3,886 | 0 | 16 | 1,002 | 1,034 | 535 | 499 | 82 | 3 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-alias.html
module Stratosphere.Resources.KMSAlias where
import Stratosphere.ResourceImports
-- | Full da... | frontrowed/stratosphere | library-gen/Stratosphere/Resources/KMSAlias.hs | mit | 1,699 | 0 | 15 | 256 | 278 | 159 | 119 | 31 | 1 |
{-# OPTIONS_HADDOCK show-extensions #-}
-- |
-- Module : Yi.Style.EmacsColours
-- License : GPL-2
-- Copyright : © Mateusz Kowalczyk, 2014
-- Maintainer : fuuzetsu@fuuzetsu.co.uk
-- Stability : experimental
-- Portability : portable
--
-- The 'Color's contained here correspond to the colours one would
--... | Fuuzetsu/yi-emacs-colours | src/Yi/Style/EmacsColours.hs | gpl-2.0 | 69,603 | 0 | 6 | 13,358 | 13,177 | 7,914 | 5,263 | 1,317 | 1 |
{- |
Module : $Header$
Description : builtin types and functions
Copyright : (c) Christian Maeder and Uni Bremen 2003
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : experimental
Portability : portable
HasCASL's builtin types and functions
-}
module H... | nevrenato/Hets_Fork | HasCASL/Builtin.hs | gpl-2.0 | 9,803 | 0 | 20 | 2,298 | 3,199 | 1,755 | 1,444 | 260 | 3 |
{-# language DeriveDataTypeable, TemplateHaskell, FlexibleInstances, MultiParamTypeClasses #-}
module Program.Cexp.Interface where
import qualified Program.Cexp.Type as T
import qualified Program.Cexp.Annotated as A
import Challenger.Partial
import Autolib.ToDoc
import Autolib.Reader
import Autolib.Reporter
import... | florianpilz/autotool | src/Program/Cexp/Interface.hs | gpl-2.0 | 1,363 | 0 | 14 | 315 | 334 | 181 | 153 | 30 | 1 |
{-
Given: A DNA string s of length at most 100 bp and an array A containing at most 20 numbers between 0 and 1.
Return: An array B having the same length as A in which B[k]
represents the common logarithm of the probability that
a random string constructed with the GC-content
found in A[k] will match s exactly.
-}
... | forgit/Rosalind | prob.hs | gpl-2.0 | 986 | 0 | 13 | 317 | 278 | 149 | 129 | 16 | 1 |
-- grid is a game written in Haskell
-- Copyright (C) 2018 karamellpelle@hotmail.com
--
-- 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 | designer/source/LevelTools/Helpers.hs | gpl-3.0 | 9,124 | 0 | 23 | 3,541 | 2,840 | 1,503 | 1,337 | 169 | 24 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveDataTypeable #-}
-- | This program compares two Infernal covariance models with each other.
-- Based on the Infernal CM scoring mechanism, a Link sequence and... | choener/CMCompare | BioInf/CMCompare.hs | gpl-3.0 | 15,590 | 0 | 21 | 4,589 | 6,539 | 3,541 | 2,998 | 253 | 7 |
module Paths_anansi
( version
) where
import Data.Version
version :: Version
version = Version [] []
| jmillikin/anansi | tests/Paths_anansi.hs | gpl-3.0 | 115 | 4 | 6 | 30 | 37 | 21 | 16 | 5 | 1 |
module Main where
import SlicerTestSuiteUtils ( runTMLTest )
import Test.Tasty ( TestTree, defaultMain, testGroup )
main :: IO ()
main = defaultMain tests
tests :: TestTree
tests =
testGroup "Run TML files" (map runTMLTest
[ "abs"
, "array"
, "array2"
, "array3"
... | jstolarek/slicer | tests/SlicerTestSuite.hs | gpl-3.0 | 1,474 | 0 | 8 | 534 | 243 | 155 | 88 | 66 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.PlayMoviesP... | brendanhay/gogol | gogol-play-moviespartner/gen/Network/Google/PlayMoviesPartner/Types/Product.hs | mpl-2.0 | 42,964 | 0 | 43 | 11,121 | 8,859 | 5,147 | 3,712 | 956 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-logging/gen/Network/Google/Resource/Logging/Folders/Logs/List.hs | mpl-2.0 | 7,107 | 0 | 19 | 1,578 | 998 | 583 | 415 | 140 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-datastore/gen/Network/Google/Resource/Datastore/Projects/RunQuery.hs | mpl-2.0 | 5,686 | 0 | 19 | 1,454 | 937 | 543 | 394 | 134 | 1 |
module Compiler (
compile
) where
import System.IO
compile :: Maybe FilePath -> IO ()
compile maybeFilename = do
sourceCode <- case maybeFilename of
Nothing -> getContents
Just filename -> readFile filename
putStr sourceCode -- DEBUG
--let theModule = compile sourceCode
--outputModuleToFile theMod... | raviqqe/jack | command/Compiler.hs | unlicense | 333 | 0 | 11 | 66 | 77 | 39 | 38 | 9 | 2 |
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Prompt.Directory
-- Copyright : (C) 2007 Andrea Rossato, David Roundy
-- License : BSD3
--
-- Maintainer :
-- Stability : unstable
-- Portability : unportable
--
-- A directory prompt for XMonad
--
-... | Balletie/.xmonad | lib/CopyPasteMonad/Prompt/Directory.hs | unlicense | 1,792 | 0 | 11 | 428 | 390 | 218 | 172 | 27 | 1 |
module Main where
import System.Console.ANSI
import Control.Concurrent
import World (World, buildWorld, iterateWorld, Position(..), Cell(..), getWorld, toList)
import Control.Monad.IO.Class
import UI.NCurses
main :: IO ()
main = runCurses $ do
setEcho False
w <- defaultWindow
let startWorld = buildWorld 25 6... | mac10688/GameOfLife-Haskell | src/Main.hs | apache-2.0 | 1,608 | 0 | 15 | 417 | 633 | 318 | 315 | 31 | 2 |
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
module Canteven.Log.MonadLog (
LoggerTImpl,
getCantevenOutput,
{- Reexports -}
LoggingConfig(LoggingConfig, level, logfile, loggers),
LoggerDetails(loggerName, loggerPackage, loggerModule, loggerLevel),
newLoggingConfig,
) w... | SumAll/haskell-canteven-log | src/Canteven/Log/MonadLog.hs | apache-2.0 | 5,759 | 0 | 21 | 1,252 | 1,261 | 702 | 559 | 116 | 4 |
module Database.Neo4j.Util.ShowBytes (
showBytes
) where
import Data.Binary
import qualified Data.Binary.Put as P
import qualified Data.ByteString.Lazy as BSL
import Data.Char (toUpper)
import Numeric (showHex)
showBytes :: Binary a => a -> String
showBytes... | boggle/neo4j-haskell-driver | src/Database/Neo4j/Util/ShowBytes.hs | apache-2.0 | 516 | 0 | 11 | 144 | 167 | 92 | 75 | 12 | 1 |
module Numeric.Euler.Integers
( multiple
, multipleOf
) where
multiple :: Int -> Int -> Bool
multiple number factor = (number `mod` factor) == 0
multipleOf :: Int -> [Int] -> Bool
multipleOf number factors = any (multiple number) factors
| decomputed/euler | src/Numeric/Euler/Integers.hs | apache-2.0 | 253 | 0 | 7 | 54 | 88 | 49 | 39 | 7 | 1 |
-- http://www.codewars.com/kata/54d418bd099d650fa000032d
module Codewars.Kata.VampireNumbers where
import Data.List
isVampire :: Integer -> Integer -> Bool
isVampire a b = (a>0 || b>0) && sort (digits $ a*b) == sort (digits a ++ digits b) where
digits = map (`mod`10) . takeWhile (>0) . iterate (`div`10) . abs | Bodigrim/katas | src/haskell/7-Vampire-Numbers.hs | bsd-2-clause | 314 | 0 | 11 | 49 | 133 | 73 | 60 | 5 | 1 |
{-
This file is part of the package xmonad-test. It is subject to the
license terms in the LICENSE file found in the top-level directory of
this distribution and at http://github.com/pjones/xmonad-test/LICENSE.
No part of the xmonad-test package, including this file, may be
copied, modified, propagated, or distributed... | pjones/xmonad-test | src/Main.hs | bsd-2-clause | 742 | 0 | 7 | 130 | 52 | 32 | 20 | 7 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
module Data.Foscam.File.DeviceId(
DeviceId(..)
, AsDeviceId(..)
, deviceId
, getDeviceIdCharacters
) where
import Control.Applicative(Applicative((<*>)), (<$>))
import Control.Category... | tonymorris/foscam-filename | src/Data/Foscam/File/DeviceId.hs | bsd-3-clause | 3,948 | 0 | 26 | 977 | 854 | 480 | 374 | 90 | 1 |
module CodeGen.Platform.X86 where
import CmmExpr
#define MACHREGS_NO_REGS 0
#define MACHREGS_i386 1
#include "../../../../includes/CodeGen.Platform.hs"
| nomeata/ghc | compiler/codeGen/CodeGen/Platform/X86.hs | bsd-3-clause | 156 | 0 | 3 | 17 | 13 | 10 | 3 | 2 | 0 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE GHCForeignImportPrim #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE UnliftedFFITypes #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
module GHC.Exts.Heap.Closures (
-- * Closures
Cl... | sdiehl/ghc | libraries/ghc-heap/GHC/Exts/Heap/Closures.hs | bsd-3-clause | 11,946 | 0 | 11 | 3,914 | 1,754 | 1,059 | 695 | -1 | -1 |
n \+\ tp = n * (100 + tp) `div` 100
| YoshikuniJujo/shinjukuhs | events/event_004/DaichiSaitoTT/func3.hs | bsd-3-clause | 36 | 0 | 8 | 11 | 29 | 15 | 14 | 1 | 1 |
-- ------------------------------------------------------------
{- |
Module : Yuuko.Text.XML.HXT.DOM.Interface
Copyright : Copyright (C) 2008 Uwe Schmidt
License : MIT
Maintainer : Uwe Schmidt (uwe@fh-wedel.de)
Stability : stable
Portability: portable
The interface to the primitive DOM... | nfjinjing/yuuko | src/Yuuko/Text/XML/HXT/DOM/Interface.hs | bsd-3-clause | 1,069 | 0 | 5 | 159 | 115 | 92 | 23 | 11 | 0 |
{-# OPTIONS_GHC -w #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : Language.Haskell.Exts.Annotated.Parser
-- Copyright : (c) Niklas Broberg 2004-2009,
-- Original (c) Simon Marlow, Sven Panne 1997-2000
-- License ... | rodrigogribeiro/mptc | src/Language/Haskell/Exts/InternalParser.hs | bsd-3-clause | 791,349 | 21,360 | 20 | 109,632 | 232,865 | 128,521 | 104,344 | 20,184 | 141 |
-- | BitTorrent metainfo files
--
-- <http://www.bittorrent.org/beps/bep_0003.html>
{-# LANGUAGE DeriveDataTypeable #-}
module Data.Torrent
( Torrent(..)
, TorrentInfo(..)
, TorrentFile(..)
, readTorrent
, serializeTorrent
, torrentSize
, showTorrent
) where
import Data.BEncode
import Data.BEncode.Parser
imp... | matthewleon/haskell-torrent | src/Data/Torrent.hs | bsd-3-clause | 3,632 | 46 | 15 | 741 | 1,113 | 588 | 525 | 97 | 2 |
{-# language CPP #-}
-- No documentation found for Chapter "FramebufferCreateFlagBits"
module Vulkan.Core10.Enums.FramebufferCreateFlagBits ( FramebufferCreateFlags
, FramebufferCreateFlagBits( FRAMEBUFFER_CREATE_IMAGELESS_BIT
... | expipiplus1/vulkan | src/Vulkan/Core10/Enums/FramebufferCreateFlagBits.hs | bsd-3-clause | 2,690 | 1 | 10 | 651 | 335 | 202 | 133 | -1 | -1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module UnitTests.GenesSpec (spec, DnaString, Allele) where
import Test.Hspec
import Test.QuickCheck
import Data.Random
import System.Random
import Data.List
import Genes
import ListUtils
import Phenotype
import UnitTests.PhenotypeSpec()
instance Arbitrary Allele where
arbi... | satai/FrozenBeagle | Simulation/Lib/testsuite/UnitTests/GenesSpec.hs | bsd-3-clause | 6,469 | 0 | 24 | 2,652 | 1,702 | 870 | 832 | 125 | 1 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE FlexibleContexts #-}
{-|
Module : Pipes.CryptoHash
Description : Utilities to calculate hash digests of 'BS.ByteString' streams
Copyright : (c) Nicolas Trangez, 2014
License : BSD3
Maintainer : ikke@nicolast.be
Stability : experimental
This module provides seve... | NicolasT/pipes-cryptohash | src/Pipes/CryptoHash.hs | bsd-3-clause | 6,254 | 0 | 14 | 1,444 | 1,053 | 585 | 468 | 83 | 1 |
module Commi.Matrix where
import Prelude hiding (id, div)
import Haste.HPlay.View hiding (head)
import Control.Monad
import Commi.Task
import Commi.Util
matrixWidget :: Input -> Widget Input
matrixWidget input = do
raw <- rawMatrix
return $ input {
inputCityMatrix = raw
}
where
n = inputCityN input ... | Teaspot-Studio/bmstu-commi-genetics-haste | Commi/Matrix.hs | bsd-3-clause | 1,088 | 0 | 15 | 269 | 464 | 244 | 220 | 27 | 4 |
module Language.ContextSemantics.LinearLambda where
import Language.ContextSemantics.Expressions
import Language.ContextSemantics.Output
import Data.Maybe
--
-- Context semantics
--
data Token = White | Black
instance Show Token where
show White = "⚪"
show Black = "⚫"
showList = showCompactList
t... | batterseapower/context-semantics | Language/ContextSemantics/LinearLambda.hs | bsd-3-clause | 3,001 | 0 | 12 | 718 | 1,128 | 612 | 516 | -1 | -1 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.NV.ShaderBufferStore
-- Copyright : (c) Sven Panne 2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : portabl... | phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/NV/ShaderBufferStore.hs | bsd-3-clause | 719 | 0 | 4 | 84 | 43 | 35 | 8 | 5 | 0 |
{-# LANGUAGE ViewPatterns, GADTs, FlexibleInstances, UndecidableInstances,
CPP #-}
#if __GLASGOW_HASKELL__ <= 708
{-# LANGUAGE OverlappingInstances #-}
{-# OPTIONS_GHC -fno-warn-unrecognised-pragmas #-}
#endif
{-# OPTIONS_GHC -fno-warn-orphans #-}
-------------------------------------------------------... | goldfirere/glambda | src/Language/Glambda/Pretty.hs | bsd-3-clause | 4,454 | 0 | 14 | 981 | 1,184 | 649 | 535 | 77 | 1 |
--(*) Find the last element of a list.
lastElmLst:: [a] -> a
lastElmLst lst = head $ reverse $ lst
myLast :: [a] -> a
myLast [] = error "Empty list"
myLast [x] = x
myLast (x:xs) = myLast $ xs
| michael-j-clark/hjs99 | src/1to10/One.hs | bsd-3-clause | 196 | 0 | 7 | 44 | 85 | 45 | 40 | 6 | 1 |
module Kreg.Options.Auth (auth) where
import Kreg.UI.UserInput (askLogins)
import qualified Registry.Client as C
import Kreg.TokenFileManager (save)
auth :: IO ()
auth = do
ids <- askLogins
case ids of
Nothing -> return ()
Just (login, password) -> do
res <- C.a... | manuelleduc/kreg-haskell | app/Kreg/Options/Auth.hs | bsd-3-clause | 537 | 0 | 17 | 201 | 147 | 75 | 72 | 16 | 3 |
{-# LANGUAGE TypeFamilies, PatternGuards #-}
-----------------------------------------------------------------------------
-- |
-- Module : Statistics.Order
-- Copyright : (C) 2012 Edward Kmett,
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Edward Kmett <ekmett@gmail.com>
-- Stability... | ekmett/order-statistics | Statistics/Order.hs | bsd-3-clause | 12,159 | 0 | 21 | 2,837 | 4,237 | 2,276 | 1,961 | 199 | 3 |
{-# LANGUAGE GeneralizedNewtypeDeriving,
FlexibleInstances,
MultiParamTypeClasses #-}
module Main where
import Control.Monad.Identity
import Data.Binary (Binary, decode, encode)
import Test.Framework (Test, defaultMain, testGroup)
import Test.Framework.Providers.QuickCheck2 (testProperty)
... | NicolasT/kontiki | bin/test.hs | bsd-3-clause | 2,102 | 0 | 13 | 522 | 498 | 274 | 224 | 40 | 1 |
module Obsidian.Coordination.CoordC where
import Obsidian.GCDObsidian.Exp
import Obsidian.GCDObsidian.Types
import Data.Word
import Data.Monoid
data LaunchConfig = LaunchConfig {launchBlocks :: Int,
launchThreads :: Int,
launchShared :... | svenssonjoel/GCDObsidian | Obsidian/Coordination/CoordC.hs | bsd-3-clause | 940 | 0 | 8 | 320 | 234 | 135 | 99 | 26 | 0 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveDataTypeable #-}
import C... | lukexi/udp-pal | reliable/MainGLClient.hs | bsd-3-clause | 3,683 | 0 | 26 | 869 | 631 | 322 | 309 | -1 | -1 |
{-# LANGUAGE RecordWildCards #-}
module Rendering
(
renderPicIO
) where
import Game
import GraphObject
import Ship
import Universe
import ClientSide
import Graphics.Gloss.Rendering
import Graphics.Gloss
import Control.Concurrent.STM
drawShield :: Ship -> Picture
drawShield s =
if shieldOn s then
tra... | cmc-haskell-2016/asteroids | src/Rendering.hs | bsd-3-clause | 1,373 | 0 | 14 | 415 | 538 | 278 | 260 | 50 | 2 |
module FooSpec (main, spec) where
import Prelude
import Test.Hspec
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "reverse" $ do
it "reverses a list" $ do
reverse [1 :: Int, 2, 3] `shouldBe` [3, 2, 1]
| hspec/hspec | hspec-discover/integration-test/with-no-implicit-prelude/FooSpec.hs | mit | 253 | 0 | 15 | 78 | 101 | 56 | 45 | 10 | 1 |
module HAHP.Data.Errors where
import Data.Map (Map)
import GHC.Generics
import Numeric.LinearAlgebra.HMatrix
import HAHP.Data.Core
-- * Errors definition
data TreeError = ConsistencyError { ahpTree :: AHPTree
... | jpierre03/hahp | src/HAHP/Data/Errors.hs | gpl-3.0 | 1,959 | 1 | 10 | 1,028 | 261 | 167 | 94 | 28 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | kim/amazonka | amazonka-ec2/gen/Network/AWS/EC2/DescribeAddresses.hs | mpl-2.0 | 5,546 | 0 | 10 | 1,145 | 678 | 421 | 257 | 70 | 1 |
{-# LANGUAGE TemplateHaskell #-}
module FRP.Peakachu.Backend.GLUT
( GlutToProgram(..), Image(..), ProgramToGlut(..), glut
, gIdleEvent, gTimerEvent, gMouseMotionEvent
, gKeyboardMouseEvent
) where
import Control.Concurrent.MVar.YC (modifyMVarPure)
import Data.ADT.Getters (mkADTGetters)
import FRP.Peak... | yairchu/peakachu | src/FRP/Peakachu/Backend/GLUT.hs | bsd-3-clause | 3,688 | 1 | 15 | 1,049 | 941 | 513 | 428 | 79 | 1 |
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, DeriveDataTypeable #-}
{-# LANGUAGE PatternGuards #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Layout.Spacing
-- Copyright : (c) Brent Yorgey
-- License : BSD-style (see LICENSE)
--
-- Main... | CaptainPatate/xmonad-contrib | XMonad/Layout/Spacing.hs | bsd-3-clause | 4,938 | 0 | 15 | 1,090 | 1,226 | 648 | 578 | 59 | 1 |
module B1.Program.Chart.SideBar
( SideBarInput(..)
, SideBarOutput(..)
, SideBarState(..)
, drawSideBar
, newSideBarState
, cleanSideBarState
) where
import Control.Monad
import Data.Maybe
import Graphics.Rendering.OpenGL
import B1.Control.TaskManager
import B1.Data.Range
import B1.Data.Symbol
import B1... | madjestic/b1 | src/B1/Program/Chart/SideBar.hs | bsd-3-clause | 22,348 | 0 | 21 | 5,184 | 5,735 | 3,089 | 2,646 | 517 | 5 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE CPP #-}
module Network.Wai.Handler.Warp.Response (
sendResponse
, sanitizeHeaderValue -- for testing
, fileRange -- for testing
, warpVersion
, addDate
, addServ... | dylex/wai | warp/Network/Wai/Handler/Warp/Response.hs | mit | 15,990 | 0 | 21 | 3,757 | 3,233 | 1,723 | 1,510 | 252 | 8 |
{- |
Module : $Header$
Description : document data type Doc for (pretty) printing in various formats
Copyright : (c) Christian Maeder and Uni Bremen 2006
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : portable
This module con... | mariefarrell/Hets | Common/Doc.hs | gpl-2.0 | 40,763 | 0 | 30 | 12,644 | 12,289 | 6,483 | 5,806 | 944 | 21 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANG... | harendra-kumar/stack | src/Stack/Fetch.hs | bsd-3-clause | 24,355 | 0 | 29 | 8,312 | 5,619 | 2,862 | 2,757 | 463 | 5 |
module Install.Plan where
import qualified Data.Map as Map
import qualified Elm.Package.Solution as S
import qualified Elm.Package.Name as N
import qualified Elm.Package.Version as V
data Plan = Plan
{ installs :: Map.Map N.Name V.Version
, upgrades :: Map.Map N.Name (V.Version, V.Version)
, removals ::... | johnpmayer/elm-package | src/Install/Plan.hs | bsd-3-clause | 1,690 | 0 | 14 | 427 | 525 | 280 | 245 | 43 | 2 |
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# LANGUAGE PatternGuards #-}
module DFAMin (minimizeDFA) where
import AbsSyn
import Data.Map (Map)
import qualified Data.Map as Map
import Data.IntSet (IntSet)
import qualified Data.IntSet as IS
import Data.IntMap (IntMap)
import qualified Data.IntMap as IM
import Data.L... | hvr/alex | src/DFAMin.hs | bsd-3-clause | 5,307 | 0 | 18 | 2,017 | 1,327 | 710 | 617 | 80 | 6 |
module Main where
import T14285a
import Prelude hiding (null)
main :: IO ()
main = do
let args = "hw"
print $ null $ pre_images 'a' (Rel (fromList [('a',sfromList args)]) (fromList [('b',sfromList args)]))
| shlevy/ghc | testsuite/tests/stranal/should_run/T14285.hs | bsd-3-clause | 212 | 0 | 15 | 39 | 100 | 54 | 46 | 7 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Reporting
-- Copyright : (c) David Waern 2008
-- License : BSD-like
--
-- Maintainer : david.waern@gmail.com
-- Stability : experimental
-- Portability : portable
--
-- Anonymous build ... | trskop/cabal | cabal-install/Distribution/Client/BuildReports/Storage.hs | bsd-3-clause | 6,030 | 0 | 19 | 1,682 | 1,357 | 751 | 606 | 108 | 4 |
{-# LANGUAGE ApplicativeDo #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
newtype MaybeA a = MaybeA (Maybe a)
deriving (Show, Functor, Applicative)
main :: IO ()
main = print $ do
x <- MaybeA $ Just 42
pure x
| olsner/ghc | testsuite/tests/ado/T11607.hs | bsd-3-clause | 237 | 0 | 10 | 63 | 72 | 37 | 35 | 8 | 1 |
{-# LANGUAGE CPP, MagicHash, BangPatterns #-}
import Data.Char
import Data.Array
import GHC.Exts
import System.IO
import System.IO.Unsafe
import Debug.Trace
import Control.Applicative (Applicative(..))
import Control.Monad (liftM, ap)
-- parser produced by Happy Version 1.16
data HappyAbsSyn
= HappyTerminal Token
... | gridaphobe/ghc | testsuite/tests/ghci.debugger/HappyTest.hs | bsd-3-clause | 16,372 | 213 | 36 | 2,947 | 4,861 | 2,563 | 2,298 | 321 | 12 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- Don't do the cunning new newtype-deriving thing
-- when the type constructor is recursive
module Main where
newtype A = A [A] deriving (Eq)
-- The derived instance would be:
-- instance Eq A where
-- (A xs) == (A ys) = xs==ys
-- $df :: Eq [A] => Eq A
-- $df d... | urbanslug/ghc | testsuite/tests/typecheck/should_compile/tc159.hs | bsd-3-clause | 395 | 0 | 10 | 99 | 80 | 48 | 32 | 6 | 1 |
module Data.YahooPortfolioManager.Plot where
import Data.Time
import Data.YahooPortfolioManager.DateUtils
import Data.YahooPortfolioManager.DbAdapter
--import System.Exit
import qualified Data.YahooPortfolioManager.TimeSeries as TS
import qualified Graphics.Gnuplot.Advanced as GP
import qualified Graphics.Gnuplot.Simp... | lhoghu/yahoo-portfolio-manager | src/Data/YahooPortfolioManager/Plot.hs | mit | 2,811 | 0 | 17 | 580 | 999 | 515 | 484 | 64 | 1 |
-- |
-- A silly library to convert integers to Strings, as an english speaker might
-- pronounce them.
--
-- For example, 2 becomes "two", 101 becomes "one hundred and one".
--
-- This is probably enormously slow and un-Haskellish, but (a) it's just for
-- practice, and (b) it's version 0.
--
module Text.SayNumber
( r... | cmball/haskell-saynumber | Text/SayNumber.hs | mit | 5,969 | 0 | 12 | 1,596 | 1,086 | 606 | 480 | 91 | 2 |
module Cascade.Parse (tryParse, doParse) where
import Cascade.Data.Ast (Item(..))
import Cascade.Data.Parse ( Result(..)
, State(..)
, Token(..)
, Parser
, Parsers
, expect
... | bash/cascade | src/Cascade/Parse.hs | mit | 1,211 | 0 | 16 | 471 | 369 | 201 | 168 | 28 | 3 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE LambdaCase #-}
module Logger ( runEvtLogger
, runServerInputLogger
, serverLogDir
, evtLogDir
, printEvents
, filterQuestEvent
, filterTravelActions
... | tort/mud-drifter | src/Logger.hs | mit | 8,127 | 0 | 19 | 2,335 | 2,377 | 1,261 | 1,116 | 138 | 5 |
{-# LANGUAGE
TemplateHaskell, TypeSynonymInstances, ScopedTypeVariables #-}
module DB (
DBLocation(..), existsDB, readDB, writeDB, backupDB )
where
import ClassyPrelude
import Prelude (read)
import Data.UUID
import System.Directory (
getAppUserDataDirectory, doesFileExist, createDirectoryIfMissing)
import q... | aelve/Jane | DB.hs | mit | 2,993 | 0 | 15 | 719 | 935 | 491 | 444 | 78 | 1 |
module Alfin.SimpleCore where
import Data.List(nub)
type Name = String
data ModName = ModName Name Name deriving Eq
data DataCon = DataCon ModName Name
data TypeCon = TypeCon ModName Name
data SCModule = SCModule ModName [SCTypeDef] [SCTopDef]
data SCTypeDef
= SCData TypeCon [Name] [SCConstr]
| SCNewType
d... | comonoidial/ALFIN | Alfin/SimpleCore.hs | mit | 4,999 | 0 | 18 | 1,266 | 2,246 | 1,160 | 1,086 | 109 | 1 |
module Bonawitz_3_8
where
import Blaze
import Tree
-- Replicating instance of Bonawitz 3.8
-- In addition, the tempering density described on pg. 48 is used
sr :: State
sr = collectStates dummyState $
(scs `tagNode` "cs") : mkDoubleParams ["p","alpha","beta"] [0.3,1.5,1.5]
scs :: State
scs = collectSta... | othercriteria/blaze | Bonawitz_3_8.hs | mit | 937 | 0 | 12 | 209 | 350 | 197 | 153 | 20 | 1 |
module Reverse where
rvrs :: String -> String
rvrs text = (take 7 (drop 9 text) ++ " " ++ drop 6 (take 8 text)) ++ " " ++ (take 5 text)
main :: IO ()
main = print $ rvrs "Curry is awesome!"
-- main = print (rvrs "Curry is awesome!")
| Numberartificial/workflow | haskell-first-principles/haskell-from-first-principles-master/03/03.08.06-moduleReverse.hs | mit | 237 | 0 | 12 | 56 | 97 | 50 | 47 | 5 | 1 |
{-# LANGUAGE OverloadedStrings #-}
-- | GHCJS support for Yesod.
module Yesod.GHCJS
(ghcjsFileDev)
where
import Control.Monad.Trans.Resource (runResourceT)
import qualified Data.ByteString as BS
import Data.Char
import Data.Conduit
import qualified Data.Conduit.Combinators as CL... | fpco/stackage-view | server/Yesod/GHCJS.hs | mit | 3,410 | 0 | 19 | 1,089 | 832 | 437 | 395 | -1 | -1 |
-----------------------------------------------------------------------------
-- |
-- Module : Main
-- Copyright : (c) Gushcha Anton 2013-2014
-- License : GNU GPLv3 (see the file LICENSE)
--
-- Maintainer : ncrashed@gmail.com
-- Stability : experimental
-- Portability : portable
--
-- Benchmarking... | NCrashed/PowerCom | src/powercom/Benchmark.hs | gpl-3.0 | 3,729 | 0 | 16 | 865 | 931 | 509 | 422 | 62 | 3 |
{- |
Module : Tct.CommandLine
Copyright : (c) Martin Avanzini <martin.avanzini@uibk.ac.at>,
Georg Moser <georg.moser@uibk.ac.at>,
Andreas Schnabl <andreas.schnabl@uibk.ac.at>,
License : LGPL (see COPYING)
Maintainer : Martin Avanzini <martin.avanzini@uibk.ac.at>
Stabilit... | mzini/TcT | source/Tct/CommandLine.hs | gpl-3.0 | 3,907 | 0 | 3 | 675 | 10 | 7 | 3 | 1 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Kevin.Damn.Protocol.Send (
sendPacket,
formatRoom,
deformatRoom,
sendHandshake,
sendLogin,
sendJoin,
sendPart,
sendMsg,
sendAction,
sendNpMsg,
sendPromote,
sendDemote,
sendBan,
sendUnban,
sendKick,
sendGet,
s... | pikajude/kevin | src/Kevin/Damn/Protocol/Send.hs | gpl-3.0 | 4,399 | 0 | 17 | 1,434 | 1,314 | 678 | 636 | 104 | 3 |
--------------------------------------------------------------------------------
-- $Id: DateTime.hs,v 1.1 2004/01/13 12:31:24 graham Exp $
--
-- Copyright (c) 2003, G. KLYNE. All rights reserved.
-- See end of this file for licence information.
-----------------------------------------------------------------... | amccausl/Swish | Swish/HaskellUtils/DateTime.hs | lgpl-2.1 | 15,345 | 0 | 20 | 4,754 | 3,872 | 2,072 | 1,800 | 178 | 3 |
module Dictionary where
import General
import Data.List (intersperse,sortBy, group,sort)
import Data.Char
import System.IO
import Util
import System.IO.Unsafe (unsafePerformIO)
import qualified Data.Set as Set
import SharedString
import Dict.ErrM
import Data.Maybe
import qualified Data.Set as Set
-- | An instance of ... | johnjcamilleri/maltese-functional-morphology | lib/Dictionary.hs | lgpl-3.0 | 16,970 | 0 | 24 | 4,037 | 7,125 | 4,001 | 3,124 | 313 | 4 |
-- P01 (*) Find the last element of a list.
lastItem :: [a] -> a
lastItem (x:[]) = x
lastItem (_:ys) = lastItem ys
-- P02 (*) Find the last but one element of a list.
lastButOne :: [a] -> a
lastButOne (x:_:[]) = x
lastButOne (_:ys) = lastButOne ys
-- P03 (*) Find the K'th element of a list.
elementAt :: Int -> [... | andreashug/ninty-nine-problems | haskell/src/lists.hs | unlicense | 554 | 0 | 9 | 134 | 232 | 124 | 108 | 13 | 2 |
-- Copyright (c) 2010 - Seweryn Dynerowicz
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agree... | sdynerow/SemiringsLibrary | Utils.hs | apache-2.0 | 1,367 | 0 | 13 | 337 | 432 | 234 | 198 | 24 | 3 |
{-# LANGUAGE TypeFamilies, FlexibleInstances, FlexibleContexts,
DeriveDataTypeable, StandaloneDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : HEP.Automation.MadGraph.Model.ADMXUDD
-- Copyright : (c) 2011, 2012 Ian-Woo Kim
--
-- License ... | wavewave/madgraph-auto-model | src/HEP/Automation/MadGraph/Model/ADMXUDD.hs | bsd-2-clause | 2,806 | 0 | 15 | 737 | 616 | 326 | 290 | 52 | 1 |
-- check if the number we supplied to it is a seven or not
lucky :: (Integral a) => a -> String
lucky 7 = "LUCKY NUMBER SEVEN!"
lucky x = "Sorry, you're out of luck, pal!"
-- without pattern matching, will use a lot if-else
sayMe :: (Integral a) => a -> String
sayMe 1 = "One!"
sayMe 2 = "Two!"
sayMe 3 = "Three!"
sayM... | sharkspeed/dororis | languages/haskell/LYHGG/4-syntax-in-functions/1-pattern-matching.hs | bsd-2-clause | 1,692 | 0 | 9 | 400 | 725 | 400 | 325 | 40 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Mismi.EC2.Data (
module Mismi.EC2.Core.Data
, fromMismiInstanceType
, toMismiInstanceType
, fromMismiVirtualizationType
, toMismiVirtualizationType
, fromMismiBlockDeviceMapping
, toMismiTag
, fromMismiTag
) where
import ... | ambiata/mismi | mismi-ec2/src/Mismi/EC2/Data.hs | bsd-3-clause | 12,144 | 0 | 8 | 4,248 | 2,597 | 1,315 | 1,282 | 615 | 142 |
{-# LANGUAGE OverloadedStrings #-}
module WreqCodeGolfExample where
import Network.Wreq (Options, defaults, param, getWith, asValue, responseBody)
import Data.Text (Text)
import Control.Lens ((&), (.~), (^.), (^..))
import Data.Aeson.Lens (key, _Array, _String)
import Control.Arrow ((>>>), (&&&))
meetupEventsUrl :: ... | FranklinChen/twenty-four-days2015-of-hackage | src/WreqCodeGolfExample.hs | bsd-3-clause | 1,160 | 0 | 15 | 276 | 324 | 187 | 137 | 29 | 1 |
-- 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.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.PhoneNumber.Tests
( tests
) where
import Data.String
imp... | facebookincubator/duckling | tests/Duckling/PhoneNumber/Tests.hs | bsd-3-clause | 1,334 | 0 | 11 | 300 | 231 | 137 | 94 | 31 | 1 |
module Lingebra (LVector, plus, average, distance, zeroVector, sumVect) where
type LVector=[Double]
plus :: LVector -> LVector -> LVector
plus = zipWith (+)
sumVect :: [LVector] -> LVector
sumVect vectors = foldr plus (zeroVector l) vectors
where l = length $ head vectors
average :: [LVector] -> LVector
... | satai/ml | src/Lingebra.hs | bsd-3-clause | 597 | 0 | 8 | 127 | 224 | 122 | 102 | 14 | 1 |
------------------------------------------------------------------------------------
import System.FilePath ((</>))
----
import qualified Paths_fancydiff as Paths_fancydiff
import System.Process (callProcess)
------------------------------------------------------------------------------------
main... | da-x/fancydiff | test/Test.hs | bsd-3-clause | 449 | 0 | 9 | 60 | 76 | 44 | 32 | 7 | 1 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE LiberalTypeSynonyms #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}... | cdepillabout/the-monad-reader-24-sample-code | src/Lib.hs | bsd-3-clause | 1,601 | 0 | 11 | 381 | 379 | 219 | 160 | 35 | 1 |
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
module FreeAgent.Server.PeerSpec (main, spec) where
import FreeAgent.AgentPrelude
import FreeAgent.Core
import Free... | jeremyjh/free-agent | core/test/FreeAgent/Server/PeerSpec.hs | bsd-3-clause | 4,330 | 0 | 19 | 1,595 | 921 | 473 | 448 | 77 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Server.Utils where
import qualified Data.ByteString.Char8 as BSC
import Data.Maybe (fromMaybe)
import Data.String (fromString, IsString(..))
import Network.Wai
import qualified Ne... | tdietert/auto-playlist | web/Server/Utils.hs | bsd-3-clause | 1,498 | 0 | 14 | 519 | 262 | 149 | 113 | 29 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Network.TCP
-- Copyright : (c) Warrick Gray 2002, Bjorn Bringert 2003-2004, Simon Foster 2004
-- License : BSD
--
-- Maintainer : bjorn@bringert.net
-- Stability : experimental
-- Portability : non-portabl... | abuiles/turbinado-blog | tmp/dependencies/http-3001.1.4/Network/TCP.hs | bsd-3-clause | 8,382 | 6 | 25 | 3,013 | 1,755 | 949 | 806 | 118 | 3 |
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE RankNTypes, ScopedTypeVariables, GADTs, EmptyDataDecls, PatternGuards, TypeFamilies, NamedFieldPuns , FlexibleInstances, MultiParamTypeClasses, TypeSynonymInstances #-}
module EvalMonad (ErrorM, VarEnv, B, State,
EvalM, runProg, inNewFrame, get_proc, get_block,
... | ezyang/hoopl | testing/EvalMonad.hs | bsd-3-clause | 4,747 | 0 | 14 | 1,452 | 1,777 | 933 | 844 | 107 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.