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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
module ImportRefs where
-- - @foo ref/imports FooVar
-- - @bar ref/imports BarVar
import ImpExpDefs (bar, foo) -- IEVar
-- - @FooBar ref/imports TypeD
import ImpExpDefs (FooBar) -- IEThingAbs
-- - @FooBar ref/imports TypeD
import ImpExpDefs (FooBar (..)) -- IEThingAll
-- - @Foo... | google/haskell-indexer | kythe-verification/testdata/basic/ImportRefs.hs | apache-2.0 | 516 | 0 | 6 | 115 | 70 | 51 | 19 | 6 | 0 |
module Arrow
{-# DEPRECATED "This library will go away soon; use Control.Arrow instead" #-}
(module Control.Arrow) where
import Control.Arrow
| FranklinChen/hugs98-plus-Sep2006 | fptools/hslibs/lang/Arrow.hs | bsd-3-clause | 147 | 0 | 5 | 24 | 18 | 12 | 6 | 4 | 0 |
{-
(c) The University of Glasgow, 1992-2006
Here we collect a variety of helper functions that construct or
analyse HsSyn. All these functions deal with generic HsSyn; functions
which deal with the instantiated versions are located elsewhere:
Parameterised by Module
---------------- -------------
R... | rahulmutt/ghcvm | compiler/Eta/HsSyn/HsUtils.hs | bsd-3-clause | 41,604 | 0 | 17 | 10,253 | 10,554 | 5,425 | 5,129 | 575 | 19 |
module Time where
import FRP.Helm.Time
import Test.HUnit hiding (Test)
import Test.Framework (Test)
import Test.Framework.Providers.HUnit
tests :: [Test]
tests = [testCase "1 ms is (1/1000) s" (inSeconds millisecond @=? 0.001),
testCase "1 s is (1/60) mins" (inMinutes second @=? 1 / 60),
testCase "1... | didmar/helm | tests/Time.hs | mit | 371 | 0 | 10 | 73 | 113 | 64 | 49 | 9 | 1 |
{-
-----------------------------------------------------------------------------
--
-- (c) The University of Glasgow 2001-2003
--
-- Access to system tools: gcc, cp, rm etc
--
-----------------------------------------------------------------------------
-}
{-# LANGUAGE CPP, ScopedTypeVariables #-}
module SysTools (
... | christiaanb/ghc | compiler/main/SysTools.hs | bsd-3-clause | 65,551 | 66 | 22 | 21,787 | 11,589 | 5,906 | 5,683 | 938 | 12 |
-- TerminalTest.hs
module TerminalTest (terminalTests) where
import Test.HUnit.Terminal
import Test.HUnit
try :: String -> String -> String -> Test
try lab inp exp' = lab ~: terminalAppearance inp ~?= exp'
terminalTests :: Test
terminalTests = test [
try "empty" "" "",
try "end in \\n" "abc\ndef\n" "abc\nde... | hspec/HUnit | tests/TerminalTest.hs | bsd-3-clause | 711 | 0 | 7 | 137 | 156 | 83 | 73 | 15 | 1 |
# Copyright (c) 2021 Synopsys, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
if SOC_QEMU_ARC_HS
config CPU_HS3X
default y
endif
| zephyrproject-rtos/zephyr | soc/arc/snps_qemu/Kconfig.defconfig.hs | apache-2.0 | 150 | 3 | 3 | 23 | 17 | 10 | 7 | -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="id-ID">
<title>Requester</title>
<maps>
<homeID>requester</homeID>
<mapref location="ma... | kingthorin/zap-extensions | addOns/requester/src/main/javahelp/help_id_ID/helpset_id_ID.hs | apache-2.0 | 960 | 77 | 66 | 155 | 404 | 205 | 199 | -1 | -1 |
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
----------------------------------------------------------------------------
-- |
-- Module : XMonad.Layout.ButtonDecoration
-- Copyright : (c) Jan Vornberger 2009
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : jan.vornberger@informatik... | adinapoli/xmonad-contrib | XMonad/Layout/ButtonDecoration.hs | bsd-3-clause | 2,047 | 0 | 11 | 335 | 244 | 144 | 100 | 16 | 1 |
module Aws.Ses.Commands.ListIdentities
( ListIdentities(..)
, ListIdentitiesResponse(..)
, IdentityType(..)
) where
import Data.Text (Text)
import qualified Data.ByteString.Char8 as BS
import Data.Maybe (catMaybes)
import Control.Applicative ((<$>))
import Data.Text.Encoding as T (encodeUtf8)
import D... | Soostone/aws | Aws/Ses/Commands/ListIdentities.hs | bsd-3-clause | 2,191 | 0 | 15 | 548 | 485 | 275 | 210 | -1 | -1 |
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-}
-- |
-- Module : Data.Text.Internal.Search
-- Copyright : (c) Bryan O'Sullivan 2009
--
-- License : BSD-style
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability : GHC
--
-- Fast substring search for 'Text', based on work by Boy... | bgamari/text | src/Data/Text/Internal/Search.hs | bsd-2-clause | 3,291 | 0 | 17 | 1,114 | 823 | 430 | 393 | 50 | 1 |
{-# LANGUAGE
ExplicitForAll
, GADTs
, RebindableSyntax #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
module T5821a
( Writer
, runWriter
, execWriter
, WriterT
, runWriterT
, execWriterT
, tell
) where
import Control.Category (Category (... | forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/rebindable/T5821.hs | bsd-3-clause | 1,755 | 0 | 12 | 565 | 713 | 389 | 324 | 51 | 1 |
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
{-# LANGUAGE RankNTypes, ConstraintKinds, KindSignatures, DataKinds, TypeFamilies #-}
module T9569 where
import GHC.Exts
data Proxy (c :: Constraint)
class Deferrable (c :: Constraint) where
defer :: Proxy c -> (c => a) -> a
deferPair :: (Deferrable c1, Deferrab... | ezyang/ghc | testsuite/tests/polykinds/T9569.hs | bsd-3-clause | 744 | 0 | 11 | 173 | 153 | 88 | 65 | -1 | -1 |
module Exercise4 where
import Test.QuickCheck
import Data.List
import Data.Maybe
{--
readN :: FilePath -> Int -> IO (Int)
readN fp n = do
c <- readFile fp
let ls = lines c
ps = dropWhile (<=0) ls
p = head ps
ns = take n (drop n ps)... | tdeekens/tda452-code | Exercises/exercise-4.hs | mit | 1,963 | 0 | 12 | 727 | 717 | 358 | 359 | -1 | -1 |
{-# LANGUAGE CPP, DeriveFunctor, TypeSynonymInstances, FlexibleInstances, TypeFamilies #-}
-- |
-- The `build` function can be used to construct multi-line string literals in
-- a monadic way:
--
-- > {-# LANGUAGE OverloadedStrings #-}
-- >
-- > import Data.String.Builder
-- >
-- > mystring :: String
-- > mystring = bu... | sol/stringbuilder | src/Data/String/Builder.hs | mit | 1,355 | 0 | 11 | 313 | 299 | 169 | 130 | 29 | 1 |
module Oden.Core.Untyped where
import Oden.Core.Operator
import Oden.Identifier
import Oden.Metadata
import Oden.QualifiedName (QualifiedName(..))
import Oden.SourceInfo
import Oden.Type.Signature
data NameBinding = NameBinding (Metadata SourceInfo) Identifi... | AlbinTheander/oden | src/Oden/Core/Untyped.hs | mit | 4,761 | 0 | 10 | 1,577 | 1,584 | 817 | 767 | 82 | 0 |
module FuzzyMatch where
import Data.Char
import ComposeLTR
import Augment
import Data.List (sortBy)
import Data.Ord (comparing, compare)
matchBonus = 1
consecutiveBonusIncrement = 1
capitalBonus = 3
boundaryBonus = 4
veryBeginningBonus = 2
matchScore = matchScoreStrict
matchSearch = matchSearchBy id
matchSearchWith... | Wizek/fuzzy-match | src/FuzzyMatch.hs | mit | 1,741 | 0 | 15 | 386 | 653 | 341 | 312 | 46 | 5 |
module Centres
( centroid
, incentre, incircle
, orthocentre
, circumcentre, circumcircle
, ninepointcentre, ninepointcircle
, symmedianpoint
, gergonnepoint
, nagelpoint
, mittenpunkt
, spiekerpoint
, feuerbachpoint
, napoleonpoint1
, exeterpoint
, outcentres, outcircles
, sidemidpoints
) where
impo... | clauderichard/Euclaude | Centres.hs | mit | 5,071 | 0 | 12 | 1,432 | 2,962 | 1,546 | 1,416 | 110 | 1 |
module Philed.Control.MonadExtras where
import Control.Monad
zipWithStrictM :: MonadPlus m => (a -> b -> m c) -> [a] -> [b] -> m [c]
zipWithStrictM _ [] [] = return []
zipWithStrictM _ (_:_) [] = mzero
zipWithStrictM _ [] (_:_) = mzero
zipWithStrictM f (x:xs) (y:ys) = liftM2 (:) (f x y) (zipWithStri... | Chattered/PhilEdCommon | Philed/Control/MonadExtras.hs | mit | 869 | 0 | 10 | 215 | 475 | 235 | 240 | 21 | 2 |
import System.Environment ( getArgs )
import ReceivedSnapshots ( Snapshot, getContents, snapshots2stalenesses32, printStalenesses32 )
import Prelude hiding (getContents)
main = do
[nodeId_string] <- getArgs
let nid = read $ nodeId_string
snapshots <- getContents nid :: IO [Snapshot]
printStalenesses... | DanielAtSamraksh/checkReceivedSnapshots | receivedSnapshots2staleness32text.hs | mit | 366 | 0 | 10 | 64 | 96 | 51 | 45 | 8 | 1 |
{-# LANGUAGE MagicHash #-}
module TeaStormApp where
import Prelude hiding (show)
import Control.Monad
import Java
import Java.Array
import JavaFX.Types
import JavaFX.Methods
data {-# CLASS "org.eta.TeaStormApp extends javafx.application.Application" #-}
TeaStormApp = TeaStormApp (Object# TeaStormApp)
start :: Sta... | filippovitale/eta-playground | javafx-teastorm/src/TeaStormApp.hs | mit | 760 | 1 | 11 | 180 | 228 | 119 | 109 | -1 | -1 |
module Generator.Sin where
import Types
generatorSin :: Generator
generatorSin = Generator $ \_ (Freq freq) (Duration duration) ->
let
samples_in_period = 44100 / freq
periods = duration * freq
in
Samples $ concat $ replicate (round periods) $
[ Sample $ sin (2 * pi * fromIntegral n / samples_in... | feuerbach/music | Generator/Sin.hs | mit | 390 | 0 | 16 | 96 | 141 | 73 | 68 | -1 | -1 |
module Meinesweeper.Constants where
--Easy height width and mines
easyH = 9 :: Int
easyW = 9 :: Int
easyM = 10 :: Int
--Medium height width and mines
mediumH = 16 :: Int
mediumW = 16 :: Int
mediumM = 40 :: Int
--Hard height width and mines
hardH = 16 :: Int
hardW = 30 :: Int
hardM = 99 :: Int
| IanConnolly/Meinesweeper | src/Meinesweeper/Constants.hs | mit | 297 | 0 | 4 | 66 | 81 | 52 | 29 | 10 | 1 |
-- Copyright 2015 Ian D. Bollinger
--
-- Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-- http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT
-- or http://opensource.org/licenses/MIT>, at your option. This file may not be
-- copied, modified, or distributed except according t... | ianbollinger/nomegen | src/Nomegen.hs | mit | 5,249 | 0 | 15 | 1,039 | 1,047 | 588 | 459 | 98 | 10 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.SVGNumberList (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.SVGNumberList
#else
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
import GHCJS.DOM.JSFFI.Gener... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/SVGNumberList.hs | mit | 352 | 0 | 5 | 33 | 33 | 26 | 7 | 4 | 0 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Arrows #-}
{-# LANGUAGE TupleSections #-}
{-# OPTIONS -fno-warn-orphans #-}
module Main (main) where
import Control.Auto
import Control.Auto.Blip
import Control.Auto.Serialize
import Control.Auto.Switch
import Control.Concurrent
import Control.Exception
import Control... | mstksg/auto-examples | src/Chatbot.hs | mit | 9,730 | 4 | 22 | 2,671 | 1,997 | 1,061 | 936 | 136 | 4 |
#!/usr/bin/env runghc
-- NB: This code deliberately avoids relying on non-standard packages
import Control.Monad
import Data.List
import Data.Version
import System.Environment
import System.Exit
import System.IO
import Distribution.PackageDescription.Parse (readPackageDescription)
import Distribution.PackageDescript... | poxu/pandoc | make_travis_yml.hs | gpl-2.0 | 8,648 | 0 | 17 | 2,634 | 1,709 | 928 | 781 | 167 | 2 |
{-# LANGUAGE ViewPatterns, FlexibleContexts #-}
{-| Ganeti lock structure
-}
{-
Copyright (C) 2014 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
... | kawamuray/ganeti | src/Ganeti/Locking/Locks.hs | gpl-2.0 | 10,169 | 0 | 11 | 2,007 | 1,972 | 1,047 | 925 | -1 | -1 |
--
-- Copyright (c) B.Zapf July 2005
--
--
-- | This is a little helper for completion interfaces.
module Yi.Keymap.Completion (
CompletionTree(CT),
stepTree, obvious, mergeTrees, listToTree, complete)
where
import Data.List
-- inside a completion tree, the a's must be unique on each level
data ... | codemac/yi-editor | src/Yi/Keymap/Completion.hs | gpl-2.0 | 2,178 | 3 | 15 | 630 | 952 | 508 | 444 | 46 | 2 |
import Data.Char
import System.IO
readfileWrows :: String -> IO ()
readfileWrows file = do
contents <- readFile file
do
putStrLn $ show (rows_func (words contents) contents [])
-- Det här är den användbara saken
rows_func :: [String] -> String ->[String] -> [String]
rows_func [] _ listwrows = reverse l... | Notogora/magictext | rows_func.hs | gpl-2.0 | 729 | 0 | 14 | 213 | 250 | 124 | 126 | 15 | 1 |
module Y2015.Q.A where
import Data.Char
solve :: Problem -> Solution
parse :: [String] -> [Problem]
data Solution = Solution Int
deriving (Eq)
instance Show Solution
where show (Solution x) = show x
data Problem = Problem { ss :: [Int]
} deriving (Eq, Show)
parse (line:rest... | joranvar/GoogleCodeJam | Y2015/Q/A.hs | gpl-3.0 | 689 | 0 | 12 | 202 | 383 | 198 | 185 | 21 | 1 |
module Main
where
import System.Environment
import Data.Binary
import Swos
main :: IO ()
main = do
args <- getArgs
if length args < 2
then putStrLn "Usage: progname <inputfile> <outputfile>"
else do
let infile = args !! 0
outfile = args !! 1
n <- decodeFile infile :: IO SWOSTeamFil... | anttisalonen/freekick2 | src/SwosConv.hs | gpl-3.0 | 350 | 0 | 13 | 98 | 106 | 53 | 53 | 14 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Config where
import Data.Text (Text)
requestQueue, respondQueue :: Text
requestQueue = "requestQueue"
respondQueue = "respondQueue"
| zudov/mueval-cloud | src/Config.hs | gpl-3.0 | 186 | 0 | 5 | 32 | 32 | 21 | 11 | 6 | 1 |
module Folgerhs.Stage where
import Data.Maybe
import Data.List
import Data.Char (isLower)
type Line = String
type Character = String
data StageEvent = Milestone Line
| Entrance [Character]
| Exit [Character]
| Speech Character
deriving (Eq, Show)
onStag... | SU-LOSP/folgerhs | src/Folgerhs/Stage.hs | gpl-3.0 | 2,094 | 0 | 13 | 602 | 763 | 399 | 364 | 54 | 5 |
----------------------------------------------------------------------
-- |
-- Module : GeneralIO
-- Maintainer : Markus Forsberg
-- Stability :
-- Portability :
--
-- Top-level functions:
-- * reading/writing morphology databases
-- * writing Lexicon, Tables, GF, XFST, Latex
-- * analysis/synthesis (Trie)
... | isido/functional-morphology-for-koine-greek | lib/GeneralIO.hs | gpl-3.0 | 4,332 | 7 | 26 | 1,305 | 1,514 | 797 | 717 | 80 | 6 |
#!/usr/bin/env runhaskell
{-# LANGUAGE OverloadedStrings #-}
-- Copyright (C) 2014-2015, Various Contributors.
--
-- 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 Li... | learnyou/website | main.hs | gpl-3.0 | 2,171 | 0 | 16 | 589 | 337 | 166 | 171 | 40 | 1 |
{- |
Module : $Header$
Description : Converting between time units.
Copyright : (c) plaimi 2014
License : GPL-3
Maintainer : plailude@plaimi.net
-} module Plailude.Data.Time.Conversion where
import qualified Data.Time.Calendar as C
import Plailude.Data.Time.Units
(
Day,
Hour,
Minute,
Month... | plaimi/plailude | src/Plailude/Data/Time/Conversion.hs | gpl-3.0 | 944 | 0 | 9 | 183 | 195 | 107 | 88 | 15 | 1 |
module Main where
import Data.List.Split
import Data.QLogic
import Data.QLogic.BoxProduct
import Data.QLogic.Examples
import Data.QLogic.Utils
import Debug.Trace
exists3 :: [(a, b, c)] -> (a -> b -> c -> Bool) -> IO ()
exists3 set pred = do
let n = length set `div` 10
mapM_ (exists3' pred) $ chunks... | ttylec/QLogic | research/hypos.hs | gpl-3.0 | 2,540 | 0 | 17 | 912 | 535 | 297 | 238 | 30 | 1 |
{-# LANGUAGE RecordWildCards #-}
module Spaceships.Render (
renderOutput
) where
import Common.Counters
import Common.Graphics
import Common.HighScores
import Control.Monad.Reader
import FRP.Yampa.Event
import Graphics.UI.SDL hiding (Event, NoEvent)
import qualified Data.Map as M
import qualified Graphics.UI.SDL as ... | CLowcay/CC_Clones | src/Spaceships/Render.hs | gpl-3.0 | 3,673 | 6 | 17 | 689 | 1,532 | 775 | 757 | 103 | 3 |
{-
BitSet - a set represented by a bitmap
This file is part of AEx.
Copyright (C) 2016 Jeffrey Sharp
AEx 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 Licens... | sharpjs/haskell-learning | src/Aex/Util/BitSet.hs | gpl-3.0 | 2,370 | 0 | 8 | 710 | 708 | 350 | 358 | 36 | 1 |
-- Print out the nth prime, where n is the 1st argument
module Main where
import AtkinSieve (primesUpTo)
import System (getArgs)
printNthPrime :: Int -> IO ()
printNthPrime n = print (n, last (primesToNth n))
main = do
args <- getArgs
printNthPrime $ read $ head args
-- Often we want a finite list of prim... | dkensinger/haskell | haskell-primes/AtkinSieveTest.hs | gpl-3.0 | 983 | 0 | 16 | 228 | 265 | 136 | 129 | 18 | 1 |
module Main where
import Primes
import Digits
allRotationsOf :: Int -> [Int]
allRotationsOf num = map rotationStartingAt [0..digitsCount(num)-1]
where
rotationStartingAt idx = digitsToNum $ take (digitsCount num) $ drop idx $ cycle (digits num)
isCircular :: Int -> Bool
isCircular num = all isPrime (allRotati... | kliuchnikau/project-euler | 035/Main.hs | apache-2.0 | 396 | 0 | 12 | 68 | 146 | 75 | 71 | 9 | 1 |
-- O(sqrt(n)) solution
isPrime' :: Int -> Int -> Bool
isPrime' _ 0 = False
isPrime' _ 1 = False
isPrime' m n
| (m * m) > n = True
| (n `mod` m) == 0 = False
| otherwise = isPrime' (m+1) n
isPrime :: Int -> Bool
isPrime n = isPrime' 2 n
| alephnil/h99 | 31.hs | apache-2.0 | 258 | 0 | 10 | 78 | 127 | 64 | 63 | 9 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Network.Protocol.Snmp.AgentX.Handlers
( route )
where
import Control.Applicative
import Control.Monad.State
import Control.Monad.Reader
import Control.Exception (RecSelError, handle)
import qualified Data.Label as DL
import qualified Data.... | chemist/agentx | src/Network/Protocol/Snmp/AgentX/Handlers.hs | bsd-3-clause | 5,125 | 0 | 21 | 1,244 | 1,741 | 880 | 861 | 95 | 8 |
{-# LANGUAGE
CPP,
DeriveDataTypeable,
FlexibleInstances,
GeneralizedNewtypeDeriving,
OverlappingInstances,
TypeFamilies,
TypeOperators,
TypeSynonymInstances,
UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
import Test.Hspec.QuickCheck (prop)
import Test.Hspec
import... | bovinespirit/enummapmap | test/UnitBoth.hs | bsd-3-clause | 3,382 | 0 | 19 | 1,010 | 1,003 | 524 | 479 | -1 | -1 |
module Text.Highlighter.Lexers.Prolog (lexer) where
import Text.Regex.PCRE.Light
import Text.Highlighter.Types
lexer :: Lexer
lexer = Lexer
{ lName = "Prolog"
, lAliases = ["prolog"]
, lExtensions = [".prolog", ".pro", ".pl"]
, lMimetypes = ["text/x-prolog"]
, lStart = root'
, lFlags = [utf8]
... | chemist/highlighter | src/Text/Highlighter/Lexers/Prolog.hs | bsd-3-clause | 2,512 | 0 | 12 | 369 | 644 | 333 | 311 | 37 | 1 |
{-# LANGUAGE QuasiQuotes #-}
import LiquidHaskell
-- xs :: [Int]
-- xs = let x0 = 0
-- x1 = 1
-- x2 = 2
-- x3 = 3
-- x4 = 4
-- x5 = 5
-- x6 = 6
-- x7 = 7
-- x8 = 8
-- x9 = 9
-- in [x0, x1, x2, x3, x4, x5, x6, x7, x8, x9]
xs :: [... | spinda/liquidhaskell | tests/gsoc15/unknown/pos/anftest.hs | bsd-3-clause | 527 | 0 | 8 | 247 | 114 | 71 | 43 | 13 | 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.AmountOfMoney.EN.JM.Corpus
( allExamples
, negativeExample... | facebookincubator/duckling | Duckling/AmountOfMoney/EN/JM/Corpus.hs | bsd-3-clause | 1,263 | 0 | 9 | 455 | 226 | 134 | 92 | 35 | 1 |
{-# LANGUAGE MagicHash, OverloadedStrings #-}
module ETA.CodeGen.Name (
qualifiedName,
fastStringText,
fastZStringText,
nameText,
nameTypeText,
nameTypeTable,
nameDataText,
idNameText,
idClassText,
moduleJavaClass,
dataConClass,
tyConClass,
moduleClass,
closure,
classFilePath,
labelToMet... | AlexeyRaga/eta | compiler/ETA/CodeGen/Name.hs | bsd-3-clause | 6,478 | 0 | 16 | 1,583 | 1,463 | 786 | 677 | -1 | -1 |
module GeometricAlgebra.Euclidean3D where
-- Types
-- Parameter 'r' is field.
data Scalar r = Scalar r
deriving (Show, Read, Eq, Ord)
data Vector r = Vector r r r
deriving (Show, Read, Eq, Ord)
data Bivector r = Bivector r r r
deriving (Show, Read, Eq, Ord)
-- | Aka Pseudoscalar.
data Trivector r = Trivecto... | phischu/geometric-algebra | src/GeometricAlgebra/Euclidean3D.hs | bsd-3-clause | 4,084 | 0 | 8 | 745 | 1,175 | 610 | 565 | 85 | 1 |
module Main(main) where
import ArithTypes
import ArithParser
import Harpy
import Harpy.X86Disassembler
import Foreign
import Control.Monad
import System.Console.Readline
import Text.ParserCombinators.Parsec
$(callDecl "callAsWord32" [t|Word32 -> IO Word32|])
main :: IO ()
main = do putStrLn "\n\n\n\nHarpy Inter... | mgrabmueller/harpy | examples/evaluator/Evaluator.hs | bsd-3-clause | 3,615 | 0 | 16 | 1,100 | 1,350 | 638 | 712 | -1 | -1 |
module SampleInstances.FirstLastWord (
FLWordSentence(..)
, FLWord(..)
, FLWordText(..)
, fLWordsInFLWordSentence
, fLWordSentencesInFLWordText
) where
import PolyGraph.ReadOnly
import PolyGraph.ReadOnly.Graph
import PolyGraph.ReadOnly.DiGraph
import PolyGraph.Buildable
import PolyGraph.Common
import ... | rpeszek/GraphPlay | play/SampleInstances/FirstLastWord.hs | bsd-3-clause | 3,046 | 0 | 13 | 601 | 653 | 368 | 285 | -1 | -1 |
module Network.XmlRpc.DTD_XMLRPC where
import Text.XML.HaXml.XmlContent
import Text.XML.HaXml.OneOfN
import Text.XML.HaXml.Types (QName(..))
{-Type decls-}
newtype I4 = I4 String deriving (Eq,Show)
newtype AInt = AInt String deriving (Eq,Show)
newtype Boolean = Boolean String deriving (Eq,Show)
newtype AStrin... | coreyoconnor/haxr | Network/XmlRpc/DTD_XMLRPC.hs | bsd-3-clause | 10,481 | 32 | 14 | 2,762 | 4,006 | 2,134 | 1,872 | 243 | 0 |
module Main where
import Test.Hspec
import Test.QuickCheck
import Types
import Lib
import Data.Matrix
import AI.GeneticAlgorithm.Simple
import Control.Applicative
main :: IO ()
main = hspec $ do
fitnessTests -- A nerds one true enemy
fitnessTests = parallel $ describe "Make sure fitness function works" $ do
it "... | octopuscabbage/genetic-sudoku | test/Spec.hs | bsd-3-clause | 1,688 | 0 | 14 | 337 | 560 | 276 | 284 | 37 | 1 |
module ProjectEuler.Problem072 (solution072) where
import Control.Monad
import Math.Sieve.Phi
genericSolution :: Integer -> Integer
genericSolution = sum . ap (map . phi . sieve) (enumFromTo 2)
solution072 :: Integer
solution072 = genericSolution 1e6
| guillaume-nargeot/project-euler-haskell | src/ProjectEuler/Problem072.hs | bsd-3-clause | 254 | 0 | 9 | 35 | 75 | 42 | 33 | 7 | 1 |
-- | Parser tests.
module Language.Java.Paragon.Monad.BaseSpec (main, spec) where
import Test.Hspec
import Language.Java.Paragon.Error
import Language.Java.Paragon.Monad.Base
-- | To be able to run this module from GHCi.
main :: IO ()
main = hspec spec
-- | Main specification function.
spec :: Spec
spec = do
desc... | bvdelft/paragon | test/Language/Java/Paragon/Monad/BaseSpec.hs | bsd-3-clause | 681 | 0 | 21 | 159 | 189 | 98 | 91 | 17 | 1 |
module Types
( Bag
, Coordinates(..)
, Direction(..)
, MoveType(..)
, Options(..)
, PlacedPiece(..)
, PlayingField
, distanceToMiddle
) where
import qualified Data.Map.Strict as Map
newtype Coordinates = C
{ cCoordinates :: (Int, Int)
} deriving (Eq)
-- the bag of remaining words
type Bag = [St... | rkrzr/shcrabble | src/Types.hs | bsd-3-clause | 2,461 | 0 | 13 | 549 | 529 | 308 | 221 | 52 | 1 |
module Munt.Primitives where
import qualified Crypto.Hash as H
import qualified Crypto.Cipher.Types as Cipher
import qualified Crypto.Error as CError
import qualified Crypto.Cipher.AES as AES
import qualified Crypto.Cipher.DES as DES
import qualified Crypto.Cipher.Blowfish as Blowfish
import qualified Crypto.Cipher.Tr... | shmookey/bc-tools | src/Munt/Primitives.hs | bsd-3-clause | 9,794 | 0 | 18 | 2,416 | 4,064 | 2,267 | 1,797 | 184 | 3 |
{-# LANGUAGE BinaryLiterals #-}
module Playlistach.Mpeg (Header(..), findHeader) where
import Data.Bits
import Data.Array.Unboxed as A
import Data.ByteString as BS
import Data.ByteString.Unsafe as BS
import Pipes
data Header = Header
{ version :: Int
, layer :: Int
, bitrate :: Maybe Int
,... | aemxdp/playlistach | backend/Playlistach/Mpeg.hs | bsd-3-clause | 3,358 | 0 | 14 | 1,148 | 1,309 | 706 | 603 | 91 | 1 |
module Object.InfPlane where
import Data.Sequence
import Colour
import Mesh
import Vec
import Ray
import Texture
import Object.Object
-------------------------------------------------------------------------------
-- Infinite Plane
data InfPlane = InfPlane Vector3 Texture Material Vector3 String
instance Show InfPl... | kearnh/HToyRayTracer | src/Object/InfPlane.hs | bsd-3-clause | 1,704 | 0 | 12 | 538 | 648 | 343 | 305 | 36 | 1 |
{-# LANGUAGE RankNTypes #-}
module Main where
import Data.Function (fix)
import Data.List (sort, unfoldr)
import System.Environment (getArgs)
import qualified Data.List as L
import qualified Data.Map as M
import qualified Data.IntMap as IM
import Test.Complexity
----------------------------------... | adarqui/Complexity | examples/simple.hs | bsd-3-clause | 5,622 | 0 | 14 | 1,449 | 2,005 | 1,064 | 941 | 116 | 2 |
{-# LANGUAGE TemplateHaskell #-}
import Test.QuickCheck
import Test.QuickCheck.Function
import Data.Maybe
import Deque
instance (Arbitrary a) => Arbitrary (Deque a) where
arbitrary = fmap fromListDEQ arbitrary
-- Checks if, after pushing x to the front of a deque, its first element is x
prop_PushFront :: Deque ... | PPitson/Deque | test/quickcheck/QuickCheckTests.hs | bsd-3-clause | 3,801 | 0 | 10 | 688 | 872 | 438 | 434 | 45 | 1 |
module Testing.STMTree where
import Testing.STMTree.Internal
import qualified Data.Tree as T
import Control.Concurrent.STM.TMVar
import Control.Monad.STM
import qualified Data.Traversable as TR
import Control.Applicative
import Control.Monad
-- type STMTree a = T.Tree (TMVar a)
data STMTree a = STMTree {
stmTree... | KevinCotrone/Testing-STMTree | src/Testing/STMTree.hs | bsd-3-clause | 1,064 | 0 | 12 | 230 | 393 | 200 | 193 | 28 | 1 |
{-# LANGUAGE TemplateHaskell #-}
module TestName (
some
) where
import Language.Haskell.TH
import Data.Char
some :: Char -> ExpQ
some c = varE 'isSpace `appE` litE (charL c)
some' :: Char -> ExpQ
some' c = varE (mkName "isSpace") `appE` litE (charL c)
| YoshikuniJujo/papillon | test/TestName.hs | bsd-3-clause | 257 | 2 | 8 | 48 | 100 | 55 | 45 | 9 | 1 |
module Util.FRP
( module Control.Applicative
, Signal
, attach
, _bindSignal
, _bindSignalOn
, _bindUnitSignal
, onSignal
, inputValue
, inputValue'
, clickSignal
, mouseSignal
, scrollXSignal
, scrollYSignal
) where
import Control.Applicative ( Applicat... | johanneshilden/liquid-epsilon | Util/FRP.hs | bsd-3-clause | 4,706 | 14 | 13 | 1,439 | 1,184 | 644 | 540 | -1 | -1 |
module Main where
import ABS
(x:i:ni:num_div:obj:i_divides:f:n:primeb:reminder:res:the_end) = [1..]
main_ :: Method
main_ [] this wb k =
Assign n (Val (I 1000)) $
Assign x (Sync is_prime [n]) $
k
is_prime :: Method
is_prime [pn] this wb k =
Assign i (Val (I 1)) $
Assign ni (Val (I pn)) $
Assign num_d... | abstools/abs-haskell-formal | benchmarks/2_primality_test/progs/1000.hs | bsd-3-clause | 1,111 | 0 | 20 | 295 | 677 | 340 | 337 | 37 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{- |
Module : Web.RBB.Types.Entry
Description : Entry data type definitions
Copyright : (c) Sebastian Witte
License : BSD3
Maintainer : woozletoff@gmail.com
Stability : ... | saep/repo-based-blog | library/Web/RBB/Types/Entry.hs | bsd-3-clause | 4,401 | 0 | 12 | 1,106 | 1,026 | 598 | 428 | 68 | 0 |
-- 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 GADT... | rfranek/duckling | Duckling/AmountOfMoney/KO/Rules.hs | bsd-3-clause | 3,713 | 0 | 19 | 846 | 939 | 540 | 399 | 112 | 2 |
{-| Contains all the functions that generate documentation
We should always try to do as little work as possible in an `IO` context.
To do so, just wrap your function in `IO` if you need to do I/O operations,
and make pure functions receive that IO result as an input
-}
{-# LANGUAGE FlexibleInstances #... | Gabriel439/Haskell-Dhall-Library | dhall-docs/src/Dhall/Docs/Core.hs | bsd-3-clause | 19,287 | 0 | 21 | 5,433 | 3,885 | 2,046 | 1,839 | 317 | 13 |
-- TODO: class/instance measures
-- TODO: add `strLen` to the fixpoint environment
{-# LANGUAGE QuasiQuotes #-}
module Lit where
import LiquidHaskell
import LiquidHaskell.Prelude
import Prelude hiding (length)
[lq| test :: {v:Int | v == 3} |]
test = length "cat"
[lq| length :: xs:[a] -> {v:Int | v = len xs}|]
leng... | spinda/liquidhaskell | tests/gsoc15/broken/pos/lit.hs | bsd-3-clause | 364 | 0 | 7 | 71 | 78 | 47 | 31 | 10 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- |
-- Module : Pact.Native.Time
-- Copyright : (C) 2016 Stuart Popejoy
-- License : BSD-style (see the file LICENSE)
-- Maintainer : Stuart Popejoy <stuart@kadena.io>
... | kadena-io/pact | src/Pact/Native/Time.hs | bsd-3-clause | 4,516 | 0 | 14 | 1,064 | 1,200 | 637 | 563 | 100 | 3 |
module Data.Digest.WebMoney
(
newSigner
, sign
, signUnsafe
, S.Signer
)
where
import qualified Data.Digest.WebMoney.Signer as S (Signer, newSigner, sign,
signUnsafe)
-- |Initializes new 'Signer' object, takes exponent and modulus as arg... | superduper/wmsigner | src/Data/Digest/WebMoney.hs | mit | 483 | 0 | 5 | 138 | 71 | 47 | 24 | 11 | 1 |
module HarmLang.Probability
where
import Data.List
import Data.Function
-- funcs that know about implementation of Dist:
-- equally
-- weightedly
-- regroup
-- pmap
-- resolve
-- joint (needn't)
-- probv
-- pgroup
-- pcombine
-- maxlikelihood
-- sample
-------------
--- TYPES ---
-------------
-- distribution with ... | lrassaby/harmlang | src/HarmLang/Probability.hs | mit | 6,276 | 0 | 18 | 1,607 | 2,765 | 1,475 | 1,290 | 102 | 4 |
{-
SockeyeChecks.hs: Helpers to run checks for Sockeye
Part of Sockeye
Copyright (c) 2017, ETH Zurich.
All rights reserved.
This file is distributed under the terms in the attached LICENSE file.
If you do not find this file, copies can be found by writing to:
ETH Zurich D-INFK, CAB F.78,... | kishoredbn/barrelfish | tools/sockeye/v1/SockeyeChecks.hs | mit | 2,131 | 0 | 16 | 736 | 628 | 317 | 311 | 47 | 3 |
data Either a b = Left a | Right b | hmemcpy/milewski-ctfp-pdf | src/content/1.6/code/haskell/snippet21.hs | gpl-3.0 | 34 | 0 | 6 | 9 | 17 | 10 | 7 | 1 | 0 |
-- NOTE: if this is NOT strict, then memory builds up like HELL
{-# LANGUAGE Strict #-}
{-# LANGUAGE FlexibleContexts #-}
module SugarScape.Core.Common
( Time
, DTime
, AgentId
, ABSEvent (..)
, ABSState (..)
, nextAgentId
, getSimTime
, mkAbsState
, defaultAbsState
) where
import Co... | thalerjonathan/phd | thesis/code/sugarscape/src/SugarScape/Core/Common.hs | gpl-3.0 | 1,048 | 0 | 12 | 269 | 271 | 157 | 114 | 36 | 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-s3/gen/Network/AWS/S3/DeleteObjects.hs | mpl-2.0 | 5,634 | 0 | 15 | 1,268 | 978 | 574 | 404 | 117 | 1 |
module TypesTest (typesTestInstances) where
import Distribution.TestSuite
import Types
import TestUtil
import Util
demandsSamePeriodAndEnvelopeEqual :: TestInstance
demandsSamePeriodAndEnvelopeEqual = buildTest result "two demands should be equal"
where result
| d1 /= d2 = Fail "demands should be equa... | Geeroar/ut-haskell | tests/TypesTest.hs | apache-2.0 | 1,883 | 0 | 11 | 505 | 417 | 212 | 205 | 37 | 1 |
#!/usr/bin/env stack
-- stack runghc --package shelly --package async
{-
It's warmly recommended to compile this script as a binary, in order to exploit multicore
parallelism, e.g.:
stack exec ghc -- --make -O2 -threaded scripts/haskell/dependencies.hs
./dependencies +RTS -N
-}
{-# LANGUAGE BangPatterns #-}... | input-output-hk/cardano-sl | scripts/haskell/dependencies.hs | apache-2.0 | 9,754 | 0 | 16 | 1,999 | 2,423 | 1,248 | 1,175 | 143 | 5 |
{-#LANGUAGE ScopedTypeVariables #-}
import Library
import CLDlib
import Compile0
import Compile1
import Compile
import qualified Interfaces.MZPrinter as HZPrinter
import System.Process
import Control.Monad.State.Lazy
runWithHZ :: Bool -> GCM a -> IO String
runWithHZ showAll gcm = do
writeFile "model.mzn" (HZPrinte... | GRACeFUL-project/GRACe | examples/multi/multiSoln.hs | bsd-3-clause | 4,562 | 0 | 15 | 1,239 | 1,527 | 770 | 757 | 108 | 2 |
import Crawl
main :: IO ()
main = do
pdfs <- downloadPDFs
txts <- (mapM convertToText pdfs >>= return.filter (/= []))
putStrLn $ "Done crawling " ++ (show $ length txts)
| abailly/hs-word2vec | main/arxiv.hs | bsd-3-clause | 179 | 0 | 12 | 40 | 77 | 38 | 39 | 6 | 1 |
{-# LANGUAGE Haskell2010 #-}
{-# LINE 1 "Data/IP/Internal.hs" #-}
module Data.IP.Internal ( IPv4(..)
, IPv6(..)
, AddrRange(..)
) where
import Data.IP.Addr
import Data.IP.Range
| phischu/fragnix | tests/packages/scotty/Data.IP.Internal.hs | bsd-3-clause | 250 | 0 | 5 | 96 | 44 | 31 | 13 | 7 | 0 |
f n arr = [x | x <- arr, i <- [1..n]]
main = do
n <- readLn :: IO Int
inputdata <- getContents
mapM_ putStrLn $ map show $ f n $ map (read :: String -> Int) $ lines inputdata | EdisonAlgorithms/HackerRank | practice/fp/intro/fp-list-replication/fp-list-replication.hs | mit | 184 | 0 | 11 | 51 | 104 | 50 | 54 | 5 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- ToJSON/FromJSON instances for Style
module JSON where
import Data.Aeson
import Text.CSL.Style
import Text.CSL.Parser
import qualified Data.Text.Encoding as T
import qualified Data.ByteString.Lazy as L
instance FromJSON Style where
parseJSON (String s) = return $ parseCSL' $ L... | nickbart1980/pandoc-citeproc | tests/JSON.hs | bsd-3-clause | 394 | 0 | 10 | 56 | 95 | 56 | 39 | 10 | 0 |
module Yi.Config.Default.MiscModes (configureMiscModes) where
import Yi.Config.Simple (ConfigM, addMode)
import Yi.Modes
configureMiscModes :: ConfigM ()
configureMiscModes = do
addMode cMode
addMode objectiveCMode
addMode cppMode
addMode cabalMode
addMode clojureMode
addMode srmcMode
addMode gitComm... | noughtmare/yi | yi-misc-modes/src/Yi/Config/Default/MiscModes.hs | gpl-2.0 | 514 | 0 | 7 | 86 | 143 | 61 | 82 | 21 | 1 |
-- Extract from a list of type constructors those (1) which need to be vectorised and (2) those
-- that could be, but need not be vectorised (as a scalar representation is sufficient and more
-- efficient). The type constructors that cannot be vectorised will be dropped.
--
-- A type constructor will only be vectorise... | snoyberg/ghc | compiler/vectorise/Vectorise/Type/Classify.hs | bsd-3-clause | 6,021 | 0 | 17 | 1,550 | 934 | 529 | 405 | 56 | 3 |
module Renaming.ConflictExport (Renaming.D6.fringe, myFringe) where
{-Rename 'myFringe' to 'fringe' will fail because of
conflicting exports. -}
import Renaming.D6
myFringe:: Tree a -> [a]
myFringe (Leaf x ) = [x]
myFringe (Branch left right) = myFringe right
| kmate/HaRe | test/testdata/Renaming/ConflictExport.hs | bsd-3-clause | 272 | 0 | 7 | 48 | 74 | 41 | 33 | 5 | 1 |
{-# LANGUAGE OverloadedStrings, DeriveFunctor #-}
module Graphics.UI.Bottle.Widgets.EventMapDoc
( makeView
, IsHelpShown(..)
, addHelp
, makeToggledHelpAdder
, Config(..)
) where
import Control.Applicative ((<$>), Applicative(..))
import Control.Lens.Operators
import Data.Function (on)
import Data.IORef (n... | sinelaw/lamdu | bottlelib/Graphics/UI/Bottle/Widgets/EventMapDoc.hs | gpl-3.0 | 6,673 | 0 | 21 | 1,282 | 2,379 | 1,291 | 1,088 | -1 | -1 |
{-# LANGUAGE TypeFamilies #-}
module AssocTyDef06 where
class Cls a where
type Typ a
type Typ a b = Int
-- Too many params for default
| ezyang/ghc | testsuite/tests/typecheck/should_fail/AssocTyDef06.hs | bsd-3-clause | 150 | 0 | 6 | 41 | 30 | 18 | 12 | 5 | 0 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module ExprBench where
import Expr
import Control.Applicative
import qualified Data.Set as Set
import Test.Target
import qualified Test.QuickCheck as QC
import qualified Test.SmallCheck ... | gridaphobe/target | bench/ExprBench.hs | mit | 2,024 | 0 | 15 | 628 | 557 | 285 | 272 | 40 | 2 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.SVGFEDropShadowElement
(js_setStdDeviation, setStdDeviation, js_getIn1, getIn1, js_getDx,
getDx, js_getDy, getDy, js_getStdDeviationX, getStdDeviationX,
js_getStdDeviationY, getStdDeviationY... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/SVGFEDropShadowElement.hs | mit | 4,171 | 40 | 11 | 658 | 856 | 487 | 369 | 71 | 1 |
splitLines [] = []
splitLines cs =
let (pre, suf) = break isLineTerminator cs
in pre : case suf of
('\r':'\n':rest) -> splitLines rest
('\r':rest) -> splitLines rest
('\n':rest) -> splitLines rest
_ -> []
isLineTerminator... | strburst/haskell-stuff | realworld/c4.hs | mit | 711 | 0 | 12 | 252 | 365 | 184 | 181 | 22 | 4 |
main :: IO()
main = do
contents <- getContents
putStrLn contents
| doylew/practice | haskell/helloworld.hs | mit | 79 | 0 | 7 | 25 | 29 | 13 | 16 | 4 | 1 |
module Data.Mole.Builder.Stylesheet where
import Data.Traversable
import Data.Map (Map)
import qualified Data.Map as M
import qualified Data.Set as S
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import qualified Data.Text.IO... | wereHamster/mole | src/Data/Mole/Builder/Stylesheet.hs | mit | 1,938 | 0 | 22 | 543 | 605 | 317 | 288 | 43 | 3 |
{-# LANGUAGE LambdaCase #-}
module PPL2.CodeGen.UntypedExpr where
import PPL2.Prelude
import PPL2.VM.Types
import Data.Tree
-- ----------------------------------------
-- | an expression is represented as a rose tree
--
-- The attributes at the inner nodes are Mnemonics of the operation
-- to be performed. At the ... | UweSchmidt/ppl2 | src/PPL2/CodeGen/UntypedExpr.hs | mit | 2,681 | 0 | 12 | 846 | 991 | 530 | 461 | 64 | 2 |
{-# LANGUAGE CPP, NoImplicitPrelude, PackageImports #-}
module Data.Ratio.Compat (
module Base
) where
import "base-compat" Data.Ratio.Compat as Base
| haskell-compat/base-compat | base-compat-batteries/src/Data/Ratio/Compat.hs | mit | 153 | 0 | 4 | 21 | 23 | 17 | 6 | 4 | 0 |
module Global where
-- The proportion (in length) of the area where points are generated
coverage :: Float
coverage = 0.5
-- The relative size of the text
textscale :: Float
textscale = 0.005
-- The window title
windowtitle = "Geometry"
-- The size of the window in pixels
pixelSize :: (Int,Int)
pixelSize = (800,6... | alphalambda/k12math | prog/lib/geo/Global.hs | mit | 508 | 0 | 5 | 93 | 89 | 58 | 31 | 12 | 1 |
{-# LANGUAGE CPP #-}
module Numeric.Limp.Program.Constraint where
import Numeric.Limp.Program.Linear
import Numeric.Limp.Program.ResultKind
import Numeric.Limp.Rep
#if MIN_VERSION_base(4,9,0) && !MIN_VERSION_base(4,11,0)
import Data.Semigroup
#endif
-- | Different kind of constraints.
--
-- These are not all necessar... | amosr/limp | src/Numeric/Limp/Program/Constraint.hs | mit | 1,978 | 0 | 11 | 510 | 550 | 308 | 242 | -1 | -1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
import Test.SmallCheck
import Test.SmallCheck.Series
import Control.Applicative
import qualified Data.Vector as V
dot :: Num a => V.Vector a -> V.Vector a -> a
dot xs ys = V.sum (V.zipWith (*) xs ys)
cauchy :: V.Vector Double -> V.Vector Doub... | riwsky/wiwinwlh | src/smallcheck_series.hs | mit | 533 | 0 | 11 | 99 | 227 | 118 | 109 | 14 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
module Data.Tuple where
fst (x,y) = x
fst3 (x,y,z) = x
snd (x,y) = y
snd3 (x,y,z) = y
thd3 (x,y,z) = z
swap (x,y) = (y,x)
curry f x y = f (x,y)
uncurry f p = f (fst p) (snd p)
| bredelings/BAli-Phy | haskell/Data/Tuple.hs | gpl-2.0 | 217 | 0 | 7 | 53 | 154 | 87 | 67 | 10 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.