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 Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude, BangPatterns, StandaloneDeriving,
MagicHash, UnboxedTuples #-}
{-# OPTIONS_HADDOCK hide #-}
#include "MachDeps.h"
#if SIZEOF_HSWORD == 4
#define DIGITS 9
#define BASE 1000000000
#elif SIZEOF_HSWORD == 8
#define DIGITS 18... | AlexanderPankiv/ghc | libraries/base/GHC/Show.hs | bsd-3-clause | 20,666 | 0 | 18 | 5,875 | 5,956 | 3,221 | 2,735 | -1 | -1 |
{-# LANGUAGE CPP #-}
import System.Posix.Signals
#include "ghcconfig.h"
main = do
print (testMembers emptySignalSet)
print (testMembers emptyset)
print (testMembers fullSignalSet)
print (testMembers fullset)
fullset = internalAbort `addSignal`
realTimeAlarm `addSignal`
busError `addSignal`
processS... | jimenezrick/unix | tests/signals001.hs | bsd-3-clause | 3,342 | 168 | 32 | 511 | 842 | 521 | 321 | 91 | 1 |
module Data.List.Assoc
( at, match
) where
import Control.Applicative (Applicative)
import Control.Monad (guard)
import Control.Lens (LensLike')
import qualified Control.Lens as Lens
import qualified Data.List.Utils as List
at :: (Applicative f, Eq k) => k -> LensLike' f [(k, a)] a
at key = Lens.traverse . Lens.f... | BrennonTWilliams/lamdu | bottlelib/Data/List/Assoc.hs | gpl-3.0 | 582 | 0 | 11 | 128 | 280 | 158 | 122 | 15 | 1 |
fac :: Integer -> Integer
fac 0 = 1
fac n = n * (fac (n - 1))
facList :: Integer -> [Integer]
facList n = map fac [0..n]
isEven :: Int -> Bool
isEven n = ((mod n 2) == 0)
retainEven :: [Int] -> [Int]
retainEven l = filter isEven l
retainEvenTuple, retainEvenTupleBetter :: [(Int, Int)] -> [Int]
retainEvenTuple l = ... | fredmorcos/attic | snippets/haskell/scans.hs | isc | 618 | 0 | 9 | 140 | 363 | 193 | 170 | 17 | 1 |
import Test.DocTest
main = doctest ["Data/Breadcrumbs.hs"]
| Lysxia/breadcrumbs | doctest.hs | mit | 59 | 0 | 6 | 6 | 17 | 9 | 8 | 2 | 1 |
module Utils.Calendar where
import Import
import Data.Time.Clock
import Data.Time.Calendar
data Semester = Fall Integer | Spring Integer | Summer Integer deriving(Show,Eq)
date :: IO (Integer,Int,Int) -- :: (year,month,day)
date = getCurrentTime >>= return . toGregorian . utctDay
getCurrSem :: IO Semester
getCurrS... | dgonyeo/lambdollars | Utils/Calendar.hs | mit | 726 | 0 | 16 | 259 | 215 | 112 | 103 | 14 | 1 |
import Control.Monad.State
import Data.SyntaxIR
import Data.List.Utils (replace)
import IO
import Lisp.Runtime
import Lisp.StdLib
import System.Exit
import Text.Parser
import Text.PrettyPrint
main = repl stdLib ""
repl :: Environment -> String -> IO ()
repl state lastInput = do
putStr (if lastInput == "" then... | AKST/lisp.hs | src/Main.hs | mit | 1,353 | 1 | 14 | 410 | 469 | 234 | 235 | 42 | 4 |
{-# LANGUAGE CPP #-}
--------------------------------------------------
{-# LANGUAGE DataKinds, KindSignatures, GADTs, ConstraintKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase, ScopedTypeVariables, TypeOperators, TupleSections #-}
--------------------------------------------------
----... | sboosali/enumerate | enumerate/sources/Enumerate/Between.hs | mit | 17,336 | 14 | 11 | 3,726 | 2,422 | 1,352 | 1,070 | 259 | 4 |
module Morph where
import qualified Data.Text.Format as Lazy
import qualified Data.Text.Lazy as Lazy
import Grammar.IO.QueryStage
import Grammar.Greek.Morph.Types
import Grammar.Greek.Morph.Paradigm.Types
import Grammar.Greek.Morph.Paradigm.Maps (endingFormGroups)
import Grammar.Greek.Script.Word
showMorph :: Morph -... | ancientlanguage/haskell-analysis | greek-morph/app/Morph.hs | mit | 1,047 | 0 | 11 | 164 | 381 | 205 | 176 | 22 | 2 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE CPP #-}
module Main
( main -- :: IO ()
) where
import Control.Monad
import Data.ByteString (ByteString)
import qualified Data.ByteString as S
import Crypto.Sign.Ed25519
import System.Environment ... | thoughtpolice/hs-ed25519 | tests/properties.hs | mit | 3,193 | 0 | 13 | 746 | 841 | 460 | 381 | 60 | 4 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
module Run where
import Control.Exception
import Control.Monad
import Development.GitRev
import System.Environment
import System.FileLock
import System.FilePath
import System.Process
... | robbinch/tinc | src/Run.hs | mit | 1,937 | 0 | 18 | 486 | 572 | 277 | 295 | 54 | 7 |
-- | This module exports the main functions of the package.
{-# LANGUAGE UnicodeSyntax #-}
module OnlineATPs
( getOnlineATPs
, getSystemATP
, onlineATPOk
, printListOnlineATPs
, getResponseSystemOnTPTP
) where
import OnlineATPs.Consult
( getOnlineATPs
, getSystemATP
, getResponseSystemOnTPTP
)
... | jonaprieto/online-atps | src/OnlineATPs.hs | mit | 441 | 0 | 5 | 81 | 62 | 40 | 22 | 15 | 0 |
module Model where
import ClassyPrelude.Yesod
import Database.Persist.Quasi
import Models.ColumnTypes
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
-- at:
-- http://www.yesodweb.com/book/persistent/
share [mkPersist sql... | darthdeus/reedink | Model.hs | mit | 440 | 0 | 9 | 58 | 61 | 35 | 26 | -1 | -1 |
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
module Week5 where
import ExprT
import Parser
import qualified StackVM as S
import qualified Data.Map as M
eval :: ExprT -> Integer
eval (Lit x) = x
eval (Add x y) = eval x + eval y
eval (Mul x y) = eval x * eval y
evalStr = fmap eval . parseExp Lit Add Mul
c... | taylor1791/cis-194-spring | src/Week5.hs | mit | 1,943 | 0 | 10 | 540 | 873 | 460 | 413 | 68 | 1 |
module Data.SymbolTable where
-- TWO(!) solutions to the problem posted at http://lpaste.net/7204216668719939584
import Control.Monad
import Control.Monad.Trans.State -- every monad is Trans these days?
import Data.Array
import Data.Maybe
-- is that discriminatory against cis-monads?
-- or are monads by definition ... | geophf/1HaskellADay | exercises/HAD/Data/SymbolTable.hs | mit | 4,266 | 0 | 11 | 862 | 395 | 220 | 175 | 23 | 1 |
-- It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square.
--
-- 9 = 7 + 2×1^2
-- 15 = 7 + 2×2^2
-- 21 = 3 + 2×3^2
-- 25 = 7 + 2×3^2
-- 27 = 19 + 2×2^2
-- 33 = 31 + 2×1^2
--
-- It turns out that the conjecture was false.
-- What is the smallest odd... | daniel-beard/projecteulerhaskell | Problems/p46.hs | mit | 791 | 0 | 15 | 184 | 185 | 101 | 84 | 12 | 1 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RecordWildCards #-}
module PostgREST.Workers
( connectionWorker
, reReadConfig
, listener
) where
import qualified Data.Aeson as JSON
import qualified Data.ByteString as BS
import qualified Hasql.Connection as C
import qualifie... | steve-chavez/postgrest | src/PostgREST/Workers.hs | mit | 10,360 | 0 | 20 | 2,667 | 1,730 | 861 | 869 | 177 | 6 |
{-# LANGUAGE ForeignFunctionInterface #-}
module System.Say.FFI (csay, csetVolume) where
import Foreign.C
import Foreign.C.String
foreign import ccall safe "cTTS.h csay"
csay :: CString -> IO ()
foreign import ccall safe "cTTS.h csetVolume"
csetVolume :: CInt -> IO ()
| tcsavage/say | src/System/Say/FFI.hs | mit | 282 | 0 | 8 | 50 | 73 | 42 | 31 | 8 | 0 |
module Display where
import Control.Monad.Trans.Class
import Control.Monad.Trans.Reader
import Graphics.UI.GLUT
import Colors
import Drawable
import SData
type DisplayReaderCallback = ReaderT SData IO ()
display :: DisplayReaderCallback
display = do
bo... | mrlovre/LMTetrys | src/Display.hs | gpl-2.0 | 786 | 0 | 12 | 231 | 267 | 138 | 129 | 26 | 1 |
{- |
Module : $Header$
Description : Signature for propositional logic
Copyright : (c) Dominik Luecke, Uni Bremen 2007
License : GPLv2 or higher, see LICENSE.txt
Maintainer : luecke@informatik.uni-bremen.de
Stability : experimental
Portability : portable
Definition of signatures for propositional... | nevrenato/Hets_Fork | Temporal/Sign.hs | gpl-2.0 | 2,505 | 0 | 10 | 652 | 456 | 255 | 201 | 36 | 1 |
module SMCDEL.Examples.SallyAnne where
import Data.Map.Strict (fromList)
import SMCDEL.Language
import SMCDEL.Symbolic.K
import SMCDEL.Symbolic.S5 (boolBddOf)
pp, qq, tt :: Prp
pp = P 0
tt = P 1
qq = P 7 -- this number does not matter
sallyInit :: BelScene
sallyInit = (BlS [pp, tt] law obs, actual) where
law =... | jrclogic/SMCDEL | src/SMCDEL/Examples/SallyAnne.hs | gpl-2.0 | 1,807 | 0 | 17 | 285 | 655 | 379 | 276 | 46 | 1 |
module CompileTest where
import Test.HUnit
import Types
import Compile
------------------------------
-- Test Suite fo Compile.hs --
------------------------------
--
-- TODOs:
-- checkVars with inlineFunction and failing leftSide
compileTests = TestList [genTest simple_vars, genTest complex_vars, genTest simple_fu... | Jem777/deepthought | test/CompileTest.hs | gpl-3.0 | 7,378 | 0 | 18 | 1,313 | 2,253 | 1,160 | 1,093 | 74 | 1 |
module Inkvizitor.UI.Debtor
( showDebtorForm
)
where
import Control.Applicative
import Data.Bits
import Graphics.UI.WX
import Graphics.UI.WXCore
import Inkvizitor.Debtor
import Inkvizitor.UI.Gui
showDebtorForm :: Gui -> Debtor -> (Debtor -> IO ()) -> IO ()
showDebtorForm g debtor onResult = do
f <- frame [text... | honzasp/inkvizitor | Inkvizitor/UI/Debtor.hs | gpl-3.0 | 3,617 | 0 | 21 | 1,054 | 1,288 | 629 | 659 | 91 | 4 |
module Jelly.Jammit
( module Sound.Jammit.Base
) where
import Sound.Jammit.Base
| mtolly/jelly | src/Jelly/Jammit.hs | gpl-3.0 | 81 | 0 | 5 | 10 | 21 | 14 | 7 | 3 | 0 |
{-# LANGUAGE GeneralizedNewtypeDeriving, TypeSynonymInstances, FlexibleInstances #-}
module Modules.Database where
import Control.Applicative
import qualified Data.Map as Map
import Test.Framework
import Test.Framework.Providers.QuickCheck2 (testProperty)
import Test.QuickCheck
import Data.List
import Control.Monad
... | cornell-pl/evolution | tests/Modules/Database.hs | gpl-3.0 | 1,650 | 0 | 15 | 481 | 533 | 265 | 268 | 45 | 1 |
module SymLens.Table where
import SymLens
import Database.Memory
import Data.Maybe (fromMaybe)
import qualified Data.Map as Map
import qualified Data.List as List
insertColumn :: Header -> Field -> SymLens Table Table
insertColumn h f =
SymLens Map.empty
(\(Table hs rs) m -> let insertFn m' k fs = case ... | cornell-pl/evolution | SymLens/Table.hs | gpl-3.0 | 2,757 | 0 | 19 | 1,183 | 906 | 463 | 443 | 44 | 3 |
{- ============================================================================
| Copyright 2011 Matthew D. Steele <mdsteele@alum.mit.edu> |
| |
| This file is part of Fallback. |
... | mdsteele/fallback | src/Fallback/View/Combat.hs | gpl-3.0 | 9,377 | 38 | 25 | 2,976 | 2,025 | 1,027 | 998 | -1 | -1 |
module Sites.GirlGenius
( girlGenius
) where
import Network.HTTP.Types.URI (decodePathSegments)
import Data.List (isInfixOf, isPrefixOf)
import qualified Data.List as DL
import Text.XML.HXT.Core
import qualified Data.Text as T
import qualified Data.ByteString.Lazy.UTF8 as UL
import qualified Data.ByteString... | pharaun/hComicFetcher | src/Sites/GirlGenius.hs | gpl-3.0 | 2,823 | 0 | 22 | 680 | 802 | 431 | 371 | 49 | 1 |
{-
Copyright (C) 2014 Richard Larocque <richard.larocque@gmail.com>
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
(at your option) any later version.
This progr... | richardlarocque/latin-db-builder | Wiki/Latin/NounDecl.hs | gpl-3.0 | 23,126 | 936 | 17 | 3,444 | 9,682 | 5,435 | 4,247 | 629 | 4 |
module Main where
import Math.Cuba
myIntegrand :: Integrand
myIntegrand xs d | length xs /= 3 = undefined
| otherwise =
[x, (sin x) * (cos y) * (exp z), x, x**2, x**6 * y * z, s] where
[x, y, z] = xs
(s) = d
main :: IO()
main = do
let results = vegas 3 6 myIntegrand (1) 0.01 ... | waterret/Cuba-haskell | src/Main.hs | gpl-3.0 | 342 | 0 | 11 | 115 | 178 | 93 | 85 | 12 | 1 |
{-# LANGUAGE QuasiQuotes, OverloadedStrings #-}
module Templates (indexTpl, notFoundTpl, doneTpl, infoTpl) where
import Text.Hamlet
import Data.Text.Lazy as T
import System.Locale (defaultTimeLocale, rfc822DateFormat)
import Data.Time.Format (formatTime)
import Data.Time.Clock (UTCTime)
import Data.Monoid
import Styl... | nico-izo/hsUrlShort | src/Templates.hs | gpl-3.0 | 2,179 | 0 | 8 | 482 | 286 | 169 | 117 | 25 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-iam/gen/Network/Google/Resource/IAM/Projects/ServiceAccounts/Create.hs | mpl-2.0 | 6,222 | 0 | 19 | 1,503 | 934 | 542 | 392 | 135 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-
Copyright 2020 The CodeWorld Authors. All rights reserved.
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/LICENS... | google/codeworld | codeworld-error-sanitizer/src/ErrorSanitizer.hs | apache-2.0 | 5,997 | 0 | 8 | 1,281 | 754 | 493 | 261 | 98 | 1 |
module Main where
import Control.Monad (forM_)
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import Data.MarkovChain (runMulti)
import Data.Serialize (decode)
import Data.Text (Text)
import qualified Data.Text as Text
import Data.Text.Encoding (decodeUtf8)
import System.Random (getStdGen)
... | cdepillabout/hn-markov-headlines | src/CreateMain.hs | apache-2.0 | 1,131 | 0 | 13 | 273 | 270 | 146 | 124 | 26 | 2 |
{-
Copyright (c) Facebook, Inc. and its affiliates.
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 ... | facebook/fbthrift | thrift/lib/hs/tests/BinaryTests.hs | apache-2.0 | 862 | 0 | 8 | 166 | 57 | 32 | 25 | 8 | 1 |
{-# LANGUAGE OverloadedStrings #-}
------------------------------------------------------------
-- Copyright : Erik de Castro Lopo <erikd@mega-nerd.com>
-- License : BSD3
------------------------------------------------------------
module Test.HttpHttpsRewriteTest
( httpToHttpsRewriteTest
)
where
import Contr... | olorin/http-proxy | Test/HttpHttpsRewriteTest.hs | bsd-2-clause | 3,739 | 0 | 15 | 1,115 | 823 | 447 | 376 | 67 | 5 |
module Main where
import ECC.Tester
import ECC.Types
import Data.Monoid
import qualified ECC.Code.BPSK as BPSK
import qualified ECC.Code.LDPC.Reference as Reference
import qualified ECC.Code.LDPC.ElimTanh as ElimTanh
import qualified ECC.Code.LDPC.Accelerate as Accelerate
codes :: Code
codes = BPSK.code <> Referenc... | ku-fpg/ecc-ldpc-accelerate | main/Main.hs | bsd-2-clause | 546 | 0 | 7 | 89 | 105 | 69 | 36 | 12 | 1 |
module Concurrent.Unamb where
import Concurrent.Unamb.Unsafe
unamb_ :: a -> b -> ()
unamb_ x y = unamb (seq x ()) (seq y ())
| ekmett/concurrent | src/Concurrent/Unamb.hs | bsd-2-clause | 127 | 0 | 8 | 25 | 62 | 33 | 29 | 4 | 1 |
module Test.LifeTest where
import Life.Type
import Life.CountAlive
import Test.HUnit
game1 = Lifegame { size = 3, board = []}
game2 = Lifegame { size = 3, board = [(1,1)]}
game3 = Lifegame { size = 3, board = [(1,1), (1,2), (2,1)]}
game4 = Lifegame { size = 3, board = [(1,1), (1,2), (2,1), (2,3)]}
game5 = Lifegame { ... | nichiyoubi/lifegame | src/Test/LifeTest.hs | bsd-3-clause | 1,573 | 14 | 10 | 277 | 823 | 493 | 330 | 28 | 1 |
{-# LANGUAGE CPP, TupleSections #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
-- | Extra functions for "Control.Concurrent".
--
-- This module includes three new types of 'MVar', namely 'Lock' (no associated value),
-- 'Var' (never empty) and 'Barrier' (filled at most once). See
-- <http://neilmitchell.blo... | mgmeier/extra | src/Control/Concurrent/Extra.hs | bsd-3-clause | 9,004 | 0 | 22 | 1,964 | 1,506 | 803 | 703 | 89 | 3 |
{-# LANGUAGE
DefaultSignatures
, ExplicitForAll
, FlexibleContexts
, ScopedTypeVariables
#-}
module Graphics.QML.MarshalObj where
import Graphics.QML.MarshalObj.Internal
import Control.Monad
import Data.Proxy
import GHC.Generics
import Graphics.QML
marshalObj :: MarshalObj t => t -> IO AnyObjRef
marsha... | marcinmrotek/hsqml-marshal | src/Graphics/QML/MarshalObj.hs | bsd-3-clause | 564 | 0 | 12 | 93 | 152 | 85 | 67 | -1 | -1 |
import Text.Read
operators :: [(String, Integer -> Integer -> Integer)]
operators = [("+", (+)), ("-", (-)), ("*", (*)), ("/", div)]
polish :: [String] -> Maybe [Integer]
polish [] = Just []
polish (s : ss) = case lookup s operators of
Just o -> case polish ss of
Just (x : y : ns) -> Just $ x `o` y : ns
_ -> Not... | YoshikuniJujo/funpaala | samples/15_fold/polish0.hs | bsd-3-clause | 413 | 0 | 14 | 95 | 230 | 126 | 104 | 12 | 4 |
{-# LANGUAGE RankNTypes, FlexibleContexts, NamedFieldPuns, ViewPatterns,OverloadedStrings #-}
{-|
-}
module Main where
import qualified Blaze.ByteString.Builder.Char.Utf8 as BZ
import System.Environment (getArgs)
import LivingFlame.Monad
import LivingFlame.Job
import LivingFlame.Trigger
main :: IO ()
main = do
[ba... | seagull-kamome/living-flame | src/Main.hs | bsd-3-clause | 553 | 0 | 12 | 111 | 124 | 67 | 57 | 15 | 1 |
module HJS.Parser.JavaScript where
class EmitHaskell a where
eHs :: a -> String
data Literal = LitInt Int
| LitString String
| LitNull
| LitBool Bool
deriving Show
data PrimExpr
= Literal Literal
| Ident String
| Brack Expr
| This... | disnet/jscheck | src/HJS/Parser/JavaScript.hs | bsd-3-clause | 5,332 | 49 | 9 | 1,793 | 1,051 | 612 | 439 | 119 | 0 |
{-# LANGUAGE DeriveGeneric #-}
module Codex.Lib.Geo.Names (
Names (..),
parseMales,
parseFemales
) where
import Codex.Lib.List
(splitBy)
import System.IO
import Control.Monad
import Data.Aeson
import GHC.Generics
import qualified Data.Map as M
data Names = Male String | Female String deriving (Show, Read, Eq, G... | adarqui/Codex | src/Codex/Lib/Geo/Names.hs | bsd-3-clause | 875 | 0 | 15 | 156 | 338 | 180 | 158 | 26 | 1 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Stack.Init
( initProject
, InitOpts (..)
) where
import Control.Exception (assert... | Fuuzetsu/stack | src/Stack/Init.hs | bsd-3-clause | 22,523 | 0 | 21 | 7,743 | 4,398 | 2,244 | 2,154 | 422 | 6 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ScopedTypeVariables #-}
module MailboxTestFilters where
import Control.Distributed.Process
import Control.Distributed.Process.Platform.Execution.Mailbox (FilterResult(..))
import Control.Monad (forM)
#if ! MIN_VERSION_base(4,6,0)
import Prelude hiding (catch, drop)
#... | haskell-distributed/distributed-process-platform | tests/MailboxTestFilters.hs | bsd-3-clause | 1,432 | 0 | 15 | 303 | 484 | 266 | 218 | 30 | 3 |
{-# LANGUAGE Rank2Types, TypeOperators, TypeSynonymInstances,
PatternGuards, FlexibleInstances #-}
----------------------------------------------------------------------
-- |
-- Module : Interface.TV.Common
-- Copyright : (c) Conal Elliott 2006
-- License : BSD3
--
-- Maintainer : conal@conal.net
... | conal/TV | src/Interface/TV/Common.hs | bsd-3-clause | 5,375 | 0 | 10 | 1,186 | 997 | 566 | 431 | 61 | 1 |
module Main (main) where
import Control.Monad (forM_)
import Control.Monad.IO.Class (liftIO)
import Data.Default (def)
import System.Directory (doesFileExist)
import Test.Hspec
import qualified Control.Monad.Trans.Resource as R
import qualified Data.Conduit as C
import qualified Data.Conduit.Binary as CB
import quali... | prowdsponsor/thumbnail-plus | tests/Main.hs | bsd-3-clause | 2,823 | 0 | 24 | 627 | 920 | 471 | 449 | 50 | 1 |
-- | Main entry point to osdkeys.
--
-- Show keys pressed with an on-screen display (Linux only)
module Main where
import Data.Maybe
import OSDKeys
import OSDKeys.Types
import System.Process
import System.Environment
import Text.Read
-- | Main entry point.
main :: IO ()
main =
do args <- getArgs
case args of... | chrisdone/osdkeys | src/main/Main.hs | bsd-3-clause | 1,028 | 0 | 12 | 327 | 221 | 114 | 107 | 26 | 3 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE NamedFieldPuns, RecordWildCards, BangPatterns,
StandaloneDeriving, GeneralizedNewtypeDeriving #-}
module Distribution.Server.Features.EditCabalFiles (
initEditCabalFilesFeature
, diffCabalRevisions
, Change(..)
) where
import Distribution.Serve... | grayjay/hackage-server | Distribution/Server/Features/EditCabalFiles.hs | bsd-3-clause | 20,599 | 0 | 18 | 5,517 | 5,058 | 2,556 | 2,502 | 402 | 5 |
{-# OPTIONS_HADDOCK not-home #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.LXC.Internal.AttachOptions
-- Copyright : (c) Nickolay Kudasov 2014
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : nickolay.kudasov@gmail.com
--
-- Int... | fizruk/lxc | src/System/LXC/Internal/AttachOptions.hs | bsd-3-clause | 7,969 | 0 | 28 | 1,878 | 1,113 | 625 | 488 | 101 | 1 |
{-# LANGUAGE OverloadedStrings #-}
-- This examples requires you to: cabal install cookie
-- and: cabal install blaze-html
import Control.Monad (forM_)
import Data.Text.Lazy (Text)
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.Encoding as T
import qualified Data.ByteString as BS
import qualified ... | xich/scotty | examples/cookies.hs | bsd-3-clause | 2,044 | 0 | 19 | 533 | 623 | 319 | 304 | 51 | 2 |
module Codec.Binary.Proquint.QuickChecks
( prop_proquints_are_roundtrippable
, prop_magic_proquints_are_roundtrippable
)
where
import Data.Word
import Test.QuickCheck
import Test.QuickCheck.Arbitrary
import Codec.Binary.Proquint
prop_proquints_are_roundtrippable :: (Eq a, ToProquint a) => a -> Property... | hellertime/proquint | src/Codec/Binary/Proquint/QuickChecks.hs | bsd-3-clause | 582 | 0 | 9 | 74 | 136 | 75 | 61 | 11 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Dalvik.AccessFlags
( AccessFlag(..)
, AccessFlags
, AccessType(..)
, flagCode
, codeFlag
, flagString
, flagsString
, hasAccessFlag
) where
import Data.Bits
import Data.List
import Data.Monoid
import Data.String
import Data.Word
import Text.Printf
type Acces... | atomb/dalvik | Dalvik/AccessFlags.hs | bsd-3-clause | 3,840 | 0 | 10 | 721 | 942 | 507 | 435 | 114 | 1 |
{-# LANGUAGE DeriveDataTypeable, RecordWildCards, CPP, ForeignFunctionInterface, ScopedTypeVariables #-}
-- | Progress tracking
module B.Shake.Progress(
Progress(..),
progressSimple, progressDisplay, progressTitlebar,
progressDisplayTester -- INTERNAL FOR TESTING ONLY
) where
import Control.Arrow
impo... | strager/b-shake | B/Shake/Progress.hs | bsd-3-clause | 10,274 | 0 | 18 | 2,502 | 2,445 | 1,314 | 1,131 | 127 | 2 |
{-# LANGUAGE ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Binary.Defer
-- Copyright : Neil Mitchell
-- License : BSD3
--
-- Maintainer : Neil Mitchell <http://community.haskell.org/~ndm/>
-- Stability : unstable
-- Portability... | ndmitchell/binarydefer | Data/Binary/Defer.hs | bsd-3-clause | 4,946 | 0 | 15 | 1,369 | 1,763 | 910 | 853 | 97 | 2 |
import Prelude hiding (readFile)
import System.IO.Strict (readFile)
| YoshikuniJujo/funpaala | samples/40_lifegame/strict.hs | bsd-3-clause | 68 | 0 | 5 | 7 | 21 | 13 | 8 | 2 | 0 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Persist.Migration
( doMigrate
) where
import NejlaCommon.Persistence.Migration as M
migrations :: [Migration]
migrations =
[ Migration { expect = Nothing -- No migrations present
, to = "1"
... | nejla/auth-service | service/src/Persist/Migration.hs | bsd-3-clause | 1,884 | 0 | 19 | 736 | 324 | 184 | 140 | 39 | 2 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GADTs #-}
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE DeriveGeneric #-}
#endif
-----... | phaazon/linear | src/Linear/Plucker.hs | bsd-3-clause | 19,599 | 0 | 17 | 5,379 | 6,969 | 3,611 | 3,358 | 447 | 1 |
module Day3 where
import Test.Hspec
import Data.List (sort, transpose)
import Data.List.Split (chunksOf)
parse :: String -> [[Integer]]
parse = chunksOf 3 . map read . words
-- Problem DSL
isTriangle l = (a + b) > c
where
[a, b, c] = sort l
-- utils
score = length . filter isTriangle
-- FIRST problem
day ... | guibou/AdventOfCode2016 | src/Day3.hs | bsd-3-clause | 701 | 0 | 15 | 162 | 245 | 131 | 114 | 21 | 1 |
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, TemplateHaskell #-}
module Data.Shapely.TH (
deriveShapely
) where
import Data.Shapely.Classes
import Language.Haskell.TH
-- TODO:
-- - GADT's? forall?
-- - support for inlining, which will be the story for:
-- data Free f a = Pure a | Free ... | jberryman/shapely-data | src/Data/Shapely/TH.hs | bsd-3-clause | 4,826 | 0 | 16 | 1,325 | 1,144 | 620 | 524 | 64 | 7 |
module Network.HaskellNet.IMAP
( connectIMAP, connectIMAPPort, connectStream
-- * IMAP commands
-- ** any state commands
, noop, capability, logout
-- ** not authenticated state commands
, login, authenticate
-- ** autenticated state commands
, select, examine, create, delete, re... | danchoi/imapget | src/Network/HaskellNet/IMAP.hs | bsd-3-clause | 18,001 | 0 | 18 | 5,765 | 5,887 | 2,966 | 2,921 | 372 | 12 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Language.Fixpoint.Types.Errors (
-- * Concrete Location Type
SrcSpan (..)
, dummySpan
,... | gridaphobe/liquid-fixpoint | src/Language/Fixpoint/Types/Errors.hs | bsd-3-clause | 5,231 | 0 | 11 | 1,232 | 1,161 | 631 | 530 | 97 | 1 |
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Main
-- Copyright : (c) 2013-2015 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
module Main (main)... | fmapfmapfmap/amazonka | amazonka-codecommit/test/Main.hs | mpl-2.0 | 543 | 0 | 8 | 103 | 76 | 47 | 29 | 9 | 1 |
module Util where
takeUntil :: (a -> Bool) -> [a] -> [a]
takeUntil _ [] = []
takeUntil p (x:xs) | p x = [x]
| otherwise = x : takeUntil p xs
| guillaume-nargeot/hpc-coveralls-testing2 | src/Util.hs | bsd-3-clause | 161 | 0 | 8 | 53 | 91 | 47 | 44 | 5 | 1 |
a :: Int
a = 0
{-@ assume b :: { b : Int | a < b } @-}
b :: Int
b = 1
{-@
f :: a : Int -> { b : Int | a < b } -> ()
@-}
f :: Int -> Int -> ()
f _ _ = ()
g :: ()
g = f a b | ssaavedra/liquidhaskell | tests/crash/Assume1.hs | bsd-3-clause | 173 | 0 | 9 | 67 | 90 | 41 | 49 | 8 | 1 |
module Util where
import System.IO.Unsafe
-- Lazier version of 'Control.Monad.sequence'
--
sequence' :: [IO a] -> IO [a]
sequence' = foldr k (return [])
where k m ms = do { x <- m; xs <- unsafeInterleaveIO ms; return (x:xs) }
mapM' :: (a -> IO b) -> [a] -> IO [b]
mapM' f xs = sequence' $ map f xs
forM' :: [a] ->... | wilbowma/accelerate | accelerate-examples/src/Util.hs | bsd-3-clause | 363 | 0 | 11 | 84 | 188 | 99 | 89 | 9 | 1 |
{-# LANGUAGE GADTs #-}
{-# OPTIONS_GHC -fno-warn-warnings-deprecations -fno-warn-incomplete-patterns #-}
module CmmContFlowOpt
( runCmmContFlowOpts
, removeUnreachableBlocks, replaceBranches
)
where
import BlockId
import Cmm
import CmmUtils
import Digraph
import Maybes
import Outputable
import Compiler.H... | mcmaniac/ghc | compiler/cmm/CmmContFlowOpt.hs | bsd-3-clause | 8,803 | 0 | 16 | 2,223 | 1,949 | 1,023 | 926 | -1 | -1 |
{-# LANGUAGE CPP #-}
-- | This is where we define a mapping from Uniques to their associated
-- known-key Names for things associated with tuples and sums. We use this
-- mapping while deserializing known-key Names in interface file symbol tables,
-- which are encoded as their Unique. See Note [Symbol table representa... | olsner/ghc | compiler/prelude/KnownUniques.hs | bsd-3-clause | 4,874 | 0 | 12 | 1,097 | 1,002 | 542 | 460 | 87 | 8 |
{-
Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is ... | infotroph/pandoc | src/Text/Pandoc/Writers/RTF.hs | gpl-2.0 | 15,663 | 306 | 24 | 4,389 | 3,827 | 1,993 | 1,834 | 280 | 6 |
-- | Carries interesting info for debugging / profiling of the
-- graph coloring register allocator.
module RegAlloc.Graph.Stats (
RegAllocStats (..),
pprStats,
pprStatsSpills,
pprStatsLifetimes,
pprStatsConflict,
pprStatsLifeConflict,
countSRMs, addSRM
) whe... | hferreiro/replay | compiler/nativeGen/RegAlloc/Graph/Stats.hs | bsd-3-clause | 11,096 | 0 | 34 | 4,090 | 2,437 | 1,274 | 1,163 | -1 | -1 |
module Fixme where
import Language.Haskell.Liquid.Prelude
{-@
data Splay a <l :: root:a -> a -> Bool, r :: root:a -> a -> Bool>
= Node (value :: a)
(left :: Splay <l, r> (a <l value>))
(right :: Splay <l, r> (a <r value>))
| Leaf
@-}
data Splay a = Leaf | Node a (Spl... | ssaavedra/liquidhaskell | benchmarks/llrbtree-0.1.1/Data/Set/fixme.hs | bsd-3-clause | 1,657 | 0 | 19 | 664 | 531 | 282 | 249 | 23 | 9 |
{-# LANGUAGE TemplateHaskell #-}
module A where
a = [|3|]
| ezyang/ghc | testsuite/tests/th/should_compile/T8025/A.hs | bsd-3-clause | 58 | 0 | 4 | 10 | 13 | 10 | 3 | 3 | 1 |
module Main where
import Idris.Core.TT
import Idris.AbsSyntax
import Idris.ElabDecls
import Idris.REPL
import IRTS.Compiler
import IRTS.CodegenJavaScript
import System.Environment
import System.Exit
import Paths_idris
data Opts = Opts {
inputs :: [FilePath]
, output :: FilePath
... | mrmonday/Idris-dev | codegen/idris-codegen-javascript/Main.hs | bsd-3-clause | 1,253 | 0 | 12 | 384 | 370 | 189 | 181 | 33 | 3 |
import Control.Exception
import Data.List
import System.FilePath
import System.Directory
import System.IO
-- Checks that openTempFile returns filenames with the right structure
main :: IO ()
main = do
fp0 <- otf ".no_prefix.hs"
print (".hs" `isSuffixOf` fp0)
print (".no_prefix" `isPrefixOf` takeFileName fp0... | urbanslug/ghc | libraries/base/tests/tempfiles.hs | bsd-3-clause | 1,130 | 0 | 14 | 381 | 351 | 175 | 176 | 28 | 3 |
{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.SVGFEConvolveMatrixElement
(pattern SVG_EDGEMODE_UNKNOWN, pattern SVG_EDGEMODE_DUPLICATE,
pattern SVG_EDG... | ghcjs/jsaddle-dom | src/JSDOM/Generated/SVGFEConvolveMatrixElement.hs | mit | 5,485 | 0 | 10 | 722 | 980 | 560 | 420 | 75 | 1 |
module ArmstrongNumbers (armstrong) where
import Data.List (unfoldr)
import Data.Tuple (swap)
armstrong :: Integral a => a -> Bool
armstrong num = (sum . map (^ exponent)) digits' == num
where
digits' = digits num
exponent = length digits'
digits :: Integral a => a -> [a]
digits = unfoldr tryExtractDigit
... | enolive/exercism | haskell/armstrong-numbers/src/ArmstrongNumbers.hs | mit | 414 | 0 | 10 | 87 | 157 | 85 | 72 | 11 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Forth
( ForthError(..)
, ForthState
, evalText
, formatStack
, empty
) where
import Data.Map (Map)
import Data.Text (Text)
import Data.Char (isSpace, isControl)
import qualified Data.Text as T
import qualified Data.Text.Read as R
import qualified Data.Map.Strict as... | pminten/xhaskell | forth/example.hs | mit | 4,312 | 0 | 16 | 1,147 | 1,668 | 907 | 761 | 124 | 6 |
module LinePrinter
( LinePrinter
, printLine
)
where
class Monad m => LinePrinter m
where printLine :: String -> m ()
| 72636c/correct-fizz-buzz | src/LinePrinter.hs | mit | 127 | 0 | 9 | 30 | 42 | 22 | 20 | 5 | 0 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.ProcessingInstruction (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.ProcessingInstruction
#else
module Graphics.UI.Gtk.WebKit.DOM.ProcessingInstruction
#endif
) where
#if (defined(ghcjs_HOST_OS) && define... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/ProcessingInstruction.hs | mit | 490 | 0 | 5 | 39 | 33 | 26 | 7 | 4 | 0 |
-- Intermission: Exercises
-- 1. Using takeWhile and dropWhile, write a function that takes a string and
-- returns a list of strings, using spaces to separate the elements of the
-- string into words, as in the following sample:
-- *Main> myWords "all i wanna do is have some fun"
-- ["all","i","wanna","do","is... | diminishedprime/.org | reading-list/haskell_programming_from_first_principles/09_06.hs | mit | 2,442 | 0 | 12 | 647 | 440 | 242 | 198 | 35 | 2 |
{-
Nume: Dimcica Tudor
Grupa: 321CC
-}
module Regexp where
import Parser
import Data.Char (isLetter, isDigit)
data Reg = Nil
| Sym Char
| Alt Reg Reg
| Seq Reg Reg
| Rep Reg
| Opt Reg
deriving Show
{-
Parser pentru extragerea unei litere sau a unei expresii dintr-o paranteza
... | free2tedy/PP | Tema2PP/Regexp.hs | mit | 4,661 | 43 | 14 | 1,208 | 1,680 | 915 | 765 | 72 | 3 |
{-# LANGUAGE DeriveGeneric, OverloadedStrings, TypeApplications #-}
module Main
( main
) where
import Control.Exception
import Control.Monad.State.Strict
import Data.Aeson
import Data.Int
import Data.Text.Encoding (encodeUtf8)
import Data.Time.Clock.POSIX
import Data.Time.LocalTime
import Data.UnixTime
import Dhal... | Javran/misc | psql-playground/src/Main.hs | mit | 5,000 | 0 | 22 | 1,215 | 1,370 | 715 | 655 | 143 | 4 |
-- |
-- Module : Control.Auto.Process
-- Description : 'Auto's useful for various commonly occurring processes.
-- Copyright : (c) Justin Le 2015
-- License : MIT
-- Maintainer : justin@jle.im
-- Stability : unstable
-- Portability : portable
--
-- Various 'Auto's describing relationships following common... | mstksg/auto | src/Control/Auto/Process.hs | mit | 14,546 | 0 | 12 | 3,423 | 1,740 | 1,058 | 682 | 127 | 2 |
module EasySDL.Draw where
import Data.StateVar
import qualified SDL.Video.Renderer as R
import GHC.Word
import Linear.V4
white :: V4 Word8
white = V4 0xFF 0xFF 0xFF 0xFF
red :: V4 Word8
red = V4 0xFF 0x00 0x00 0xFF
green :: V4 Word8
green = V4 0x00 0x80 0x00 0xFF
blue :: V4 Word8
blue = V4 0x00 0x00 0xFF 0xFF
yel... | ublubu/shapes | shapes-demo/src/EasySDL/Draw.hs | mit | 1,404 | 0 | 8 | 307 | 582 | 290 | 292 | 54 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module UserSpec where
import App
import Server
import User
import Util
import Data.Aeson hiding (json)
import qualified Data.ByteString.Char8 as BS
import qualified Data.Map as M
import Data.Maybe
import Data.Monoid
import Data.Text
import N... | benweitzman/PhoBuddies-Servant | test/UserSpec.hs | mit | 3,511 | 0 | 20 | 964 | 862 | 457 | 405 | 68 | 1 |
{-|
Module : Control.Monad.Bayes.Inference.SMC
Description : Sequential Monte Carlo (SMC)
Copyright : (c) Adam Scibior, 2015-2020
License : MIT
Maintainer : leonhard.markert@tweag.io
Stability : experimental
Portability : GHC
Sequential Monte Carlo (SMC) sampling.
Arnaud Doucet and Adam M. Johansen. 201... | adscib/monad-bayes | src/Control/Monad/Bayes/Inference/SMC.hs | mit | 2,852 | 0 | 12 | 720 | 383 | 212 | 171 | -1 | -1 |
module TestLabel (
prop_domination_reflexive,
prop_domination_antisymmetric,
prop_domination_transitive,
prop_noBetter,
prop_domination_total
) where
import Label
import Data.Set as Set
import Test.QuickCheck
import TestModel
-- LABELS
-- Labels are made to store a partial solution
-- to the ... | Vetii/SCFDMA | test/TestLabel.hs | mit | 1,310 | 0 | 14 | 308 | 299 | 171 | 128 | 25 | 1 |
cutBrackets :: (Show a, Show b) => [(a, b)] -> String
cutBrackets (x:xs)
| null xs = show (fst x) ++ " " ++ show (snd x)
| otherwise = show (fst x) ++ " " ++ show (snd x) ++ "\n" ++ cutBrackets xs
func :: Floating a => a -> a
func x = x
dxList :: (Enum a, Floating a) => a -> a -> [a]
dxList dx xmax = [0.0, dx... | mino2357/Hello_Haskell | test/ode.hs | mit | 749 | 0 | 12 | 195 | 445 | 228 | 217 | 17 | 1 |
#!/usr/bin/env runhaskell
{-# LANGUAGE OverloadedStrings #-}
import Turtle
main :: IO ()
main = do
stdout (runWatch $ findSrc)
findSrc :: Shell Text
findSrc = inproc "find" ["./src"] ""
runWatch :: Shell Text -> Shell Text
runWatch s = inproc "entr" ["cabal", "build"] s
| dzotokan/minions-api | scripts/watch.hs | mit | 278 | 0 | 9 | 51 | 93 | 48 | 45 | 9 | 1 |
-- Same as 035_delay_rec, but using combLoop instead.
module T where
import Tests.Basis
c = proc a ->
(| combLoop (\y ->
do x <- (| delayAC (falseA -< ()) (returnA -< y) |)
y <- orA -< (a, x)
returnA -< (x, y)) |)
c' = proc a ->
(| combLoop (\x ->
do x'... | peteg/ADHOC | Tests/02_SequentialCircuits/036_delay_combLoop.hs | gpl-2.0 | 936 | 20 | 17 | 305 | 410 | 218 | 192 | -1 | -1 |
module Access.System.Timeout
( module System.Timeout
, TimeoutAccess(..)
) where
import System.Timeout
import Access.Core
class Access io => TimeoutAccess io where
timeout' :: Int -> IO a -> io (Maybe a)
instance TimeoutAccess IO where
-- |Wrap an 'IO' computation to time... | bheklilr/base-io-access | Access/System/Timeout.hs | gpl-2.0 | 2,289 | 0 | 11 | 502 | 114 | 75 | 39 | 9 | 0 |
{- hpodder component
Copyright (C) 2006-2007 John Goerzen <jgoerzen@complete.org>
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
(at your option) any later versio... | jgoerzen/hpodder | Commands/ImportIpodder.hs | gpl-2.0 | 4,200 | 0 | 16 | 1,310 | 910 | 457 | 453 | 83 | 2 |
{-# LANGUAGE NoImplicitPrelude, DeriveGeneric, TemplateHaskell, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}
module Graphics.UI.Bottle.Animation
( R, Size, Layer
, Image(..), iUnitImage, iRect
, Frame(..), frameImagesMap, unitImages
, draw, nextFrame, mapIdentities
, unitSquare, ... | rvion/lamdu | bottlelib/Graphics/UI/Bottle/Animation.hs | gpl-3.0 | 8,843 | 0 | 15 | 2,645 | 2,779 | 1,473 | 1,306 | -1 | -1 |
module Favorites where
import Graphics.UI.Gtk
import Data.IORef
import Network.Tremulous.Protocol
import qualified Data.ByteString as B
import Types
import GtkUtils
import ClanFetcher
import FindPlayers (playerLikeList)
import Constants
import Config
favlist = ["gt", "meisseli", ".gm"]
newFavorites:: Bundle -> Set... | Cadynum/Apelsin | src/Favorites.hs | gpl-3.0 | 1,222 | 4 | 17 | 189 | 404 | 201 | 203 | -1 | -1 |
module SpacialGameMsg.RunSGMsg where
import SpacialGameMsg.SGModelMsg
import qualified PureAgents2DDiscrete as Front
import qualified Graphics.Gloss as GLO
import Graphics.Gloss.Interface.IO.Simulate
import qualified PureAgentsConc as PA
import System.Random
import Data.Maybe
import Data.List
import Control.Monad.ST... | thalerjonathan/phd | public/ArtIterating/code/haskell/PureAgentsConc/src/SpacialGameMsg/RunSGMsg.hs | gpl-3.0 | 4,493 | 0 | 12 | 1,668 | 1,170 | 621 | 549 | 86 | 1 |
module Lookups where
import Data.List (elemIndex)
import Control.Applicative (liftA2)
added :: Maybe Integer
added = (+3) <$> (lookup 3 $ zip [1,2,3] [4,5,6])
y :: Maybe Integer
y = lookup 3 $ zip [1,2,3] [4,5,6]
z :: Maybe Integer
z = lookup 2 $ zip [1,2,3] [4,5,6]
tupled :: Maybe (Integer, Integer)
tupled = (,) ... | thewoolleyman/haskellbook | 17/05/haskell-club/Lookups.hs | unlicense | 938 | 0 | 9 | 202 | 461 | 258 | 203 | 31 | 1 |
module Main where
import Prelude hiding (any)
import Grammar
import Any
import Control.Applicative((<$>))
import Control.Monad(void)
import qualified System.Random as R
main :: IO ()
main = void ((genSome :: IO S) >>= print)
genSome :: Any a => IO a
genSome = runGen any <$> R.newStdGen
| versusvoid/grammar-generator | src/Main.hs | unlicense | 291 | 0 | 9 | 50 | 112 | 65 | 47 | 11 | 1 |
{-# LANGUAGE FlexibleContexts #-}
-- Liang Barsky Line Clipping Algorithm
-- https://en.wikipedia.org/wiki/Liang%E2%80%93Barsky_algorithm
module Data.Geometry.Clip.Internal.LineLiangBarsky (
clipLineLb
, clipLinesLb
) where
import qualified Data.Aeson as Aeson
import qualified Data.Foldable... | sitewisely/zellige | src/Data/Geometry/Clip/Internal/LineLiangBarsky.hs | apache-2.0 | 5,506 | 0 | 15 | 1,077 | 1,587 | 811 | 776 | 97 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.