_id stringlengths 64 64 | repository stringlengths 6 84 | name stringlengths 4 110 | content stringlengths 0 248k | license null | download_url stringlengths 89 454 | language stringclasses 7
values | comments stringlengths 0 74.6k | code stringlengths 0 248k |
|---|---|---|---|---|---|---|---|---|
799d9fcedb3be97e981a4819d08f52769a04bc21935c5eea9c88a9e09b3768d4 | spurious/sagittarius-scheme-mirror | conditions.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
sagittarius / conditions.scm - Extra builtin conditions
;;;
Copyright ( c ) 2010 - 2015 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/sitelib/sagittarius/conditions.scm | scheme | coding : utf-8 ; -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaime... | sagittarius / conditions.scm - Extra builtin conditions
Copyright ( c ) 2010 - 2015 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT... |
87bbcde0417b451a563f1a1a8748c786f256368202f5f266d8f28f3e6940ae75 | ayamada/copy-of-svn.tir.jp | logger.scm | #!/usr/bin/env gosh
;;; coding: euc-jp
;;; -*- scheme -*-
;;; vim:set ft=scheme ts=8 sts=2 sw=2 et:
$ Id$
;;; 使い方:
;;; - 以下のパラメータを使いたいように変更する
;;; - 実行する(おそらく、以下のようなコマンドになる)
./logger.scm > stdout.log 2>&1 &
;;; - 実行すると、S式書式のログが*log-dir*に、チャンネル別、日別で保存される
;;; - INVITEされると、そのチャンネルに入る
(add-load-path "../lib")
(add-... | null | https://raw.githubusercontent.com/ayamada/copy-of-svn.tir.jp/101cd00d595ee7bb96348df54f49707295e9e263/iafse/pib/tags/0.2.1/sample/logger.scm | scheme | coding: euc-jp
-*- scheme -*-
vim:set ft=scheme ts=8 sts=2 sw=2 et:
使い方:
- 以下のパラメータを使いたいように変更する
- 実行する(おそらく、以下のようなコマンドになる)
- 実行すると、S式書式のログが*log-dir*に、チャンネル別、日別で保存される
- INVITEされると、そのチャンネルに入る
----
最初に、JOINする
接続断
inviteのみ処理する、あとはスルー | #!/usr/bin/env gosh
$ Id$
./logger.scm > stdout.log 2>&1 &
(add-load-path "../lib")
(add-load-path "lib")
(add-load-path ".")
(use pib)
(define *irc-server-ip* "localhost")
(define *irc-server-port* 6667)
(define *irc-server-encoding* "iso-2022-jp")
(define *irc-server-pass* #f)
(define *nick* "logger")
(de... |
324a89c213b42661216d14fd0fdbc4e780683e81f515bcc915023ea2fbb3739e | rabbitmq/rabbitmq-erlang-client | amqp_channels_manager.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
%%
@private
-module(amqp_channels_manager).
-incl... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-erlang-client/2022e01c515d93ed1883e9e9e987be2e58fe15c9/src/amqp_channels_manager.erl | erlang |
Pid -> Number
---------------------------------------------------------------------------
---------------------------------------------------------------------------
---------------------------------------------------------------------------
gen_server callbacks
-----------------------------------------------------... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
@private
-module(amqp_channels_manager).
-include("a... |
ffc81cc85b8a7b43bba73d14d2858847404632e1bd493b9d82e54e06d6cd6146 | robert-strandh/Gsharp | position.lisp | (in-package :gsharp)
(defun foo-buffer ()
(let* ((staves (list (make-fiveline-staff)))
(segment (make-instance 'segment :layers (list (make-layer staves :body (make-slice :bars nil)))))
(segments (list segment)))
(let ((staff (car staves)))
(loop for j upto 2
for bar = (make-me... | null | https://raw.githubusercontent.com/robert-strandh/Gsharp/20b4a30ebf1e211bf421563278d425b3b06607e9/Mxml/tests/position.lisp | lisp | (in-package :gsharp)
(defun foo-buffer ()
(let* ((staves (list (make-fiveline-staff)))
(segment (make-instance 'segment :layers (list (make-layer staves :body (make-slice :bars nil)))))
(segments (list segment)))
(let ((staff (car staves)))
(loop for j upto 2
for bar = (make-me... | |
86cac265e4393048347adfd886bf6d6d8fc15f9ff4ae3f892be5403906afba1d | ghc/testsuite | syn-perf.hs | {-# LANGUAGE TypeOperators, DeriveDataTypeable #-}
This is a performance test . In GHC 6.4 , it simply would n't compile
-- because the types got exponentially large, due to poor handling of
-- type synonyms
module ShouldCompile where
import Data.Word
import Data.Int
import Data.Typeable
data HNil = HNil ... | null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_compile/syn-perf.hs | haskell | # LANGUAGE TypeOperators, DeriveDataTypeable #
because the types got exponentially large, due to poor handling of
type synonyms
synonym gave rise to exponential behaviour |
This is a performance test . In GHC 6.4 , it simply would n't compile
module ShouldCompile where
import Data.Word
import Data.Int
import Data.Typeable
data HNil = HNil deriving (Eq,Show,Read)
data HCons e l = HCons e l deriving (Eq,Show,Read)
type e :*: l = HCons e l
In GHC 6.4 the deeply - nested ... |
021a7cc5ed8ba3ce89e8d8a8749fcf7ae1ced0f9d5c877217d143b536aab532e | freizl/dive-into-haskell | Sum.hs | -- |
module Sum where
import Control.Monad
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
data Sum a b = First a | Second b
deriving (Eq, Show)
instance Functor (Sum a) where
fmap _ (First a) = First a
fmap f (Second b) = Second (f b)
instance Applicative (Sum a) where
... | null | https://raw.githubusercontent.com/freizl/dive-into-haskell/b18a6bfe212db6c3a5d707b4a640170b8bcf9330/readings/haskell-book/18/Sum.hs | haskell | | |
module Sum where
import Control.Monad
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
data Sum a b = First a | Second b
deriving (Eq, Show)
instance Functor (Sum a) where
fmap _ (First a) = First a
fmap f (Second b) = Second (f b)
instance Applicative (Sum a) where
pur... |
3a8b9a7f0ccc38e6f4e45c970a3308c6aa7c88e0b00c499f77ce36c127da1b89 | soimort/GrassMudHorse | VM.hs | module VM where
import Data.Array
import System.IO
import System.Random
Stack machine for running whitespace programs
data Instruction =
Push Integer
| Dup
| Ref Int
| Shuffle
| Slide Int
| Swap
| Discard
| Infix Op
| Store
| Retrieve
| Label Label
| Ca... | null | https://raw.githubusercontent.com/soimort/GrassMudHorse/ae0145e8bb02e119951730338c1e4d9e3bb435e3/VM.hs | haskell | Running individual instructions
Digging out labels from wherever they are
Shuffling the stack | module VM where
import Data.Array
import System.IO
import System.Random
Stack machine for running whitespace programs
data Instruction =
Push Integer
| Dup
| Ref Int
| Shuffle
| Slide Int
| Swap
| Discard
| Infix Op
| Store
| Retrieve
| Label Label
| Ca... |
85472efa26170b39076ff019ba31e56246de71e8873efca2bf1d650fbaa69d8a | haskell-unordered-containers/unordered-containers | Debug.hs | # LANGUAGE CPP #
# LANGUAGE TypeApplications #
-- | = WARNING
--
-- This module is considered __internal__.
--
The Package Versioning Policy _ _ does not apply _ _ .
--
-- The contents of this module may change __in any way whatsoever__
-- and __without any warning__ between minor versions of this pack... | null | https://raw.githubusercontent.com/haskell-unordered-containers/unordered-containers/70fdaa75b6e7660dcefdf217702390596d9df43c/Data/HashMap/Internal/Debug.hs | haskell | | = WARNING
This module is considered __internal__.
The contents of this module may change __in any way whatsoever__
and __without any warning__ between minor versions of this package.
Authors importing this module are expected to track development
closely.
= Description
| An error corresponding to a brok... | # LANGUAGE CPP #
# LANGUAGE TypeApplications #
The Package Versioning Policy _ _ does not apply _ _ .
Debugging utilities for ' 's .
module Data.HashMap.Internal.Debug
( valid
, Validity(..)
, Error(..)
, SubHash
, SubHashPath
) where
import Data.Bits (complemen... |
181ce363ae8adb7e7cb1edaa45fe80a11b1fc6b55aa8a16f23ba33d7d2a1fcda | soegaard/sci | info.rkt | #lang info
;;; Info file for sci which contains multiple collections
;; Name
; No name since `sci` consists of multiple collections.
(define collection 'multi)
;; Version
(define version "1.0")
;; Dependencies
(define deps '("base"
))
;;
(define implies '())
;; Package Description
(define pkg-de... | null | https://raw.githubusercontent.com/soegaard/sci/f6f7ddb56754775a773c54db47efb1e11c5bc3b0/info.rkt | racket | Info file for sci which contains multiple collections
Name
No name since `sci` consists of multiple collections.
Version
Dependencies
Package Description | #lang info
(define collection 'multi)
(define version "1.0")
(define deps '("base"
))
(define implies '())
(define pkg-desc "Scientific libraries: flomat (floating point matrices)")
(define pkg-authors '(soegaard))
(define build-deps '("rackunit-lib"
"scribble-lib"
... |
c7fe35f9e4ba899f52bcf4b544fffe471bbe827834c310f652db68fae3fcbfad | DimaSamoz/mezzo | Harmony.hs |
-----------------------------------------------------------------------------
-- |
-- Module : Mezzo.Model.Harmony
-- Description : Mezzo harmonic constructs
Copyright : ( c )
License : MIT
--
-- Maintainer :
-- Stability : experimental
-- Portability : portable
--
Module providing th... | null | https://raw.githubusercontent.com/DimaSamoz/mezzo/13365da8907a714e34540f7a1d99898b67816cc9/src/Mezzo/Model/Harmony.hs | haskell | ---------------------------------------------------------------------------
|
Module : Mezzo.Model.Harmony
Description : Mezzo harmonic constructs
Maintainer :
Stability : experimental
Portability : portable
--------------------------------------------------------------------------- |
Copyright : ( c )
License : MIT
Module providing the external interface to the Mezzo harmonic constructs .
module Mezzo.Model.Harmony (module X) where
Uses import / export shortcut as suggested by HLint .
import Mezzo.Model.Harmony.Chords as X
import Mezzo.Model.Harmony.Functional as X
import ... |
58dbb28704e49671e5c7693a1bdd4d847e9e43f16a850e871f2485eeeae1d214 | cbaggers/daft | update.lisp | (in-package :daft)
;;------------------------------------------------------------
(defun update-actor-kinds (scene)
(with-slots (kinds) scene
;;
(do-hash-vals actor-kind kinds
(reset-surviving-actor-array actor-kind))
;;
(do-hash-vals actor-kind kinds
(unless (static-p actor-kind)
... | null | https://raw.githubusercontent.com/cbaggers/daft/62c4b8b883469eb121b55403b6afabad5052b204/src/actor-kind/update.lisp | lisp | ------------------------------------------------------------
------------------------------------------------------------ | (in-package :daft)
(defun update-actor-kinds (scene)
(with-slots (kinds) scene
(do-hash-vals actor-kind kinds
(reset-surviving-actor-array actor-kind))
(do-hash-vals actor-kind kinds
(unless (static-p actor-kind)
(clrhash (kinds-to-test-collision-with actor-kind))
(loop
... |
8bf7d2ba845d40a383ec28809ce8af1323acf26bd561bf815455062ae51ad6ea | gwathlobal/CotD | window-display-msg.lisp | (in-package :cotd)
(defclass display-msg-window (window)
((msg-line :initarg :msg-line :accessor display-msg-window/msg-line :type string)
(x :initform nil :initarg :x :accessor display-msg-window/x)
(y :initform nil :initarg :y :accessor display-msg-window/y)
(w :initform nil :initarg :w :accessor display-... | null | https://raw.githubusercontent.com/gwathlobal/CotD/d01ef486cc1d3b21d2ad670ebdb443e957290aa2/src/windows/window-display-msg.lisp | lisp | (when (< max-str (+ cur-str (truncate (sdl:height rect) (sdl:char-height sdl:*default-font*))))
draw rectangle for text
draw text
draw rectangle for prompt
draw prompt
escape - quit with nil
space, enter - quit with t | (in-package :cotd)
(defclass display-msg-window (window)
((msg-line :initarg :msg-line :accessor display-msg-window/msg-line :type string)
(x :initform nil :initarg :x :accessor display-msg-window/x)
(y :initform nil :initarg :y :accessor display-msg-window/y)
(w :initform nil :initarg :w :accessor display-... |
29819f12c6dd3be441c7ed735be1e1eea56d1f8f04a38148e4deab5d697d09be | ocaml-ppx/ocamlformat | attribute_and_expression.ml | let _ = f (2 [@test 2])
let tail1 = [1; 2] [@hello]
let tail2 = 0 :: ([1; 2] [@hello])
let tail3 = 0 :: ([] [@hello])
let _ = ("%d" : _ format) [@p]
let _ = (`B `N : p2) [@p]
let _ = (`So (`Se (`So `O)) : podd) [@p]
| null | https://raw.githubusercontent.com/ocaml-ppx/ocamlformat/3d1c992240f7d30bcb8151285274f44619dae197/test/passing/tests/attribute_and_expression.ml | ocaml | let _ = f (2 [@test 2])
let tail1 = [1; 2] [@hello]
let tail2 = 0 :: ([1; 2] [@hello])
let tail3 = 0 :: ([] [@hello])
let _ = ("%d" : _ format) [@p]
let _ = (`B `N : p2) [@p]
let _ = (`So (`Se (`So `O)) : podd) [@p]
| |
1486c82a2bcf3bfa91d068ce14599963431fd29c66d79ba7f02126423d61b96e | jgoerzen/gopherbot | NetClient.hs |
Copyright ( C ) 2005 < >
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 distributed in ... | null | https://raw.githubusercontent.com/jgoerzen/gopherbot/6e83120d108d7b73d82e9949c41148bd260d17aa/NetClient.hs | haskell | FIXME: this is slow and a RAM hog. |
Copyright ( C ) 2005 < >
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 distributed in ... |
3f3f7cc2c538cc969462ff23b2e0c03f7b1a6e5a7f55a6989b35c4e8116ce643 | picrin-scheme/picrin | 322.scm | (import (scheme base)
(picrin test))
(test-begin)
(test #f (string->number "12e43r"))
(test #f (string->number "12e+43r"))
(test #f (string->number "12e+43e54"))
(test #f (string->number "12e+"))
(test #f (string->number "12e"))
(test #f (string->number "+12e"))
(test #f (string->number "-12e"))
(test ... | null | https://raw.githubusercontent.com/picrin-scheme/picrin/2af16bc88fbfca2efafd27ca9e5006d73c06f6fb/t/issue/322.scm | scheme | (import (scheme base)
(picrin test))
(test-begin)
(test #f (string->number "12e43r"))
(test #f (string->number "12e+43r"))
(test #f (string->number "12e+43e54"))
(test #f (string->number "12e+"))
(test #f (string->number "12e"))
(test #f (string->number "+12e"))
(test #f (string->number "-12e"))
(test ... | |
e7224bad07f4c7e9dc9ded4ac97f2ad520bfd7869fd6ef2036335cb1f7baf990 | janestreet/base_quickcheck | recursive_types.ml | open! Base
open Base_quickcheck
module _ : sig
type t =
| Leaf
| Node of t * t
[@@deriving quickcheck]
end = struct
type t =
| Leaf
| Node of t * t
[@@deriving hash]
let quickcheck_generator =
let open Generator.Let_syntax in
Generator.recursive_union
[ Generator.return Leaf ]
... | null | https://raw.githubusercontent.com/janestreet/base_quickcheck/21c7bb951c92365bcbc0d96e0242ac32b7f07a68/examples/recursive_types.ml | ocaml | Observers can be derived from hash functions for most types.
A good strategy for shrinking a recursive node is to try replacing the node with its
recursive children, and also try pointwise-shrinking all fields of the node.
In order to bound recursion depth, we rely on the fact that the [list] generator
... | open! Base
open Base_quickcheck
module _ : sig
type t =
| Leaf
| Node of t * t
[@@deriving quickcheck]
end = struct
type t =
| Leaf
| Node of t * t
[@@deriving hash]
let quickcheck_generator =
let open Generator.Let_syntax in
Generator.recursive_union
[ Generator.return Leaf ]
... |
00fc2136bfa3ba1f085bddb5dbfa07c08441c11d4a939bd257f99a66f18e0806 | coccinelle/coccinelle | check_exhaustive_pattern.ml |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... | null | https://raw.githubusercontent.com/coccinelle/coccinelle/2d0014efa4c67f4c3b4687cbcddef7456bad9aac/engine/check_exhaustive_pattern.ml | ocaml | dependencies_to_adjust: pattern.ml, transformaton.ml
seems same as the above
-------------------------------------------------------------------------
for C
for control flow nodes
| ( F.ExprStatement (_, _)
| F.IfHeader (_, _) | F.SwitchHeader (_, _)
| F.WhileHeader (_, _) | (* F.DoHeader (_, _) | ... |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... |
7774aa8c77f81ad2f36eb77201d02eff49275531875e3c6b0c76d83cd61530dd | ddmcdonald/sparser | pdf-to-txt.lisp | (in-package :sparser)
;; N.B. To run pdf-to-txt, your PATH environment variable must include the path
to python3 . If you 're in unix & sbcl like me , You can check your PATH with
( sb - posix : " PATH " ) . For me , this returns something different than in
;; my terminal (echo $PATH). I'm still not sure why. ... | null | https://raw.githubusercontent.com/ddmcdonald/sparser/304bd02d0cf7337ca25c8f1d44b1d7912759460f/Sparser/code/s/tools/pdf-to-txt.lisp | lisp | N.B. To run pdf-to-txt, your PATH environment variable must include the path
my terminal (echo $PATH). I'm still not sure why. Even though my python3
Solution: I now add my python3 location to my PATH env var in my .sbclrc using
[-MDM]
should we bother adding words like this here?
== PDF-TO-TXT ==============... | (in-package :sparser)
to python3 . If you 're in unix & sbcl like me , You can check your PATH with
( sb - posix : " PATH " ) . For me , this returns something different than in
location is in my terminal $ PATH , it was n't in my PATH from sbcl .
( sb - posix : < var > ) and ( sb - posix : setenv < var >... |
930e6048643e47b3c9a309ddd5822daf1b8e26342cc20a69133ad438333f576c | fgalassi/cs61a-sp11 | l8.5.scm | (define (make-adder n) (lambda (x) (+ x n)))
; make-adder
(make-adder 3)
; closure
((make-adder 3) 5)
8
(define (f x) (make-adder 3))
; f
(f 5)
; closure
(define g (make-adder 3))
; g
(g 5)
8
(define (make-funny-adder n)
(lambda (x)
(if (equal? x 'new)
(set! n (+ n 1))
(+ x n))))
; make-funny-adde... | null | https://raw.githubusercontent.com/fgalassi/cs61a-sp11/66df3b54b03ee27f368c716ae314fd7ed85c4dba/homework/l8.5.scm | scheme | make-adder
closure
f
closure
g
make-funny-adder
h
j
okay
closure
k
m
p
okay
r
okay
s
closure
wrong number of arguments
closure
okay
ask
okay
x
x | (define (make-adder n) (lambda (x) (+ x n)))
(make-adder 3)
((make-adder 3) 5)
8
(define (f x) (make-adder 3))
(f 5)
(define g (make-adder 3))
(g 5)
8
(define (make-funny-adder n)
(lambda (x)
(if (equal? x 'new)
(set! n (+ n 1))
(+ x n))))
(define h (make-funny-adder 3))
(define j (make-funny-adde... |
7446ffd0cfd56fd39558298689cb461d9a0bb26b0a21d612c754c1ba9d41d233 | zxymike93/SICP | 459.rkt | 1 . query meeting on friday morning
(and (meeting ?division (Friday ?time))
(lisp-value assoc 'am ?time))
2 .
(rule (meeting-time ?person ?day-and-time)
(and (job ?person (?division . ?work))
(or (meeting ?division ?day-and-time)
(meeting whole-company ?day-and-time))))
3 ... | null | https://raw.githubusercontent.com/zxymike93/SICP/9d8e84d6a185bf4d7f28c414fc3359741384beb5/chapter4/459.rkt | racket | 1 . query meeting on friday morning
(and (meeting ?division (Friday ?time))
(lisp-value assoc 'am ?time))
2 .
(rule (meeting-time ?person ?day-and-time)
(and (job ?person (?division . ?work))
(or (meeting ?division ?day-and-time)
(meeting whole-company ?day-and-time))))
3 ... | |
8e838af3ce138076799e1e65611f70679dfbd2f5681c8b0ffa4e0f5ac2e86288 | isovector/algebra-driven-design | ClueState.hs | # LANGUAGE MultiParamTypeClasses #
module Scavenge.ClueState where
import Test.QuickCheck
import QuickSpec
import Data.Semigroup
data ClueState
! 1
deriving stock (Eq, Ord, Show, Enum, Bounded)
! 2
instance Observe () ClueState ClueState
instance Arbitrary ClueState where
arbitrary = elements $ enumFromTo ... | null | https://raw.githubusercontent.com/isovector/algebra-driven-design/11c514e75feb22b51ae744379664549e06e70de4/code/Scavenge/ClueState.hs | haskell | ---------------------------------------------------------------------------- | # LANGUAGE MultiParamTypeClasses #
module Scavenge.ClueState where
import Test.QuickCheck
import QuickSpec
import Data.Semigroup
data ClueState
! 1
deriving stock (Eq, Ord, Show, Enum, Bounded)
! 2
instance Observe () ClueState ClueState
instance Arbitrary ClueState where
arbitrary = elements $ enumFromTo ... |
af55c6d8f99b6c6e851949ab8338c6e0a34d39ebed7b68bde8a5e5010d2faba5 | bydriv/mhc | Identity.hs | MHC : Minimal Haskell Compiler © 2018 < >
--
-- MHC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
-- (at your option) any later version.
--
-- MHC is distributed in... | null | https://raw.githubusercontent.com/bydriv/mhc/8d09a407cc069e1212f10bef16c4604a47192f51/Control/Monad/Identity.hs | haskell |
MHC is free software: you can redistribute it and/or modify
(at your option) any later version.
MHC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more ... | MHC : Minimal Haskell Compiler © 2018 < >
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
module Control.Monad.Identity (Identity, runIdentity) where
im... |
a9abb93ab255933d8850519ea58e41f87413eda98d6036d004c77e051123cc27 | billstclair/trubanc-lisp | padding.lisp | padding.lisp -- implementation of various padding algorithms
(in-package :crypto)
(defclass padding () ())
(defgeneric add-padding-bytes (padding text start block-offset block-size)
(:documentation "Add padding to the block in TEXT beginning at position
START. Padding is done according to PADDING and assumes th... | null | https://raw.githubusercontent.com/billstclair/trubanc-lisp/5436d2eca5b1ed10bc47eec7080f6cb90f98ca65/systems/ironclad_0.26/padding.lisp | lisp | PKCS7 padding | padding.lisp -- implementation of various padding algorithms
(in-package :crypto)
(defclass padding () ())
(defgeneric add-padding-bytes (padding text start block-offset block-size)
(:documentation "Add padding to the block in TEXT beginning at position
START. Padding is done according to PADDING and assumes th... |
997fc6c6af1810adb5e7bd63881461193349a41cc7896e5793c2e04934a00622 | janestreet/command_rpc | heartbeat_streamable_state_rpc_intf.ml | open! Core
open! Async
open! Import
module type Heartbeat_streamable_state_rpc = sig
val server : min_version:int -> max_version:int -> _ Rpc.Implementation.t list
val client : version:int -> (int, unit, unit) Streamable.State_rpc.t
end
| null | https://raw.githubusercontent.com/janestreet/command_rpc/23eb43f63655f8ed23703995f44e6db317ac69bc/test/protocol/heartbeat_streamable_state_rpc_intf.ml | ocaml | open! Core
open! Async
open! Import
module type Heartbeat_streamable_state_rpc = sig
val server : min_version:int -> max_version:int -> _ Rpc.Implementation.t list
val client : version:int -> (int, unit, unit) Streamable.State_rpc.t
end
| |
b6fd45a29b8be9426a126e23935b72da5fd2d2e3b7ef827f1c07518cf0cc1e08 | generateme/cljplot | label.clj | (ns cljplot.impl.label
(:require [cljplot.common :refer :all]
[clojure2d.core :refer :all]
[fastmath.core :as m]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-primitive-operators)
(defmethod data-extent :label [_ _ _] nil)
(defmethod prepare-data :label [_ ... | null | https://raw.githubusercontent.com/generateme/cljplot/1eb865439653c95940be18421298c574b7ce8db6/src/cljplot/impl/label.clj | clojure | (ns cljplot.impl.label
(:require [cljplot.common :refer :all]
[clojure2d.core :refer :all]
[fastmath.core :as m]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-primitive-operators)
(defmethod data-extent :label [_ _ _] nil)
(defmethod prepare-data :label [_ ... | |
da6c1eb6ed5ded6ad34b5e5e83714c97d5d68c738c13cc660073ace16962d1c5 | charlieg/Sparser | currencies.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
copyright ( c ) 1993 -- all rights reserved
;;;
;;; File: "currencies"
;;; Module: "grammar;model:dossiers:"
version : October 1993
initiated 10/22/93 v2.3 from treatment of 11/91
(in-package :sparser)
(define-individual 'currency :... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/grammar/model/dossiers/currencies.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
File: "currencies"
Module: "grammar;model:dossiers:" | copyright ( c ) 1993 -- all rights reserved
version : October 1993
initiated 10/22/93 v2.3 from treatment of 11/91
(in-package :sparser)
(define-individual 'currency :denomination "dollar"
:country "United States" )
(define-individual 'currency :denomination "dollar"... |
6bff28dc7a3e3a469b2f02b987d24de432d046418e579a8d387ae8892612e03b | cram2/cram | tasks.lisp | ;;;
Copyright ( C ) 2009 by < >
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are met:
;;;
;;; * Redistributions of source code must retain the above copyright
;;; notice, this l... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_core/cram_occasions_events/src/tasks.lisp | lisp |
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Re... | Copyright ( C ) 2009 by < >
* Neither the name of Willow Garage , Inc. nor the names of its
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR ... |
e2cee1206b15dc42366b5082919fe72c6dde0207a48c5c28fbcade2851470e92 | picty/parsifal | getopt.ml | type action_result =
| ActionDone
| ParameterExpected
| ShowUsage of string option
type option_type =
| Set of bool ref
| Clear of bool ref
| IntVal of int ref
| IntFun of (int -> action_result)
| FloatVal of float ref
| TrivialFun of (unit -> unit)
| SimpleFun of (unit -> action_result)
| String... | null | https://raw.githubusercontent.com/picty/parsifal/767a1d558ea6da23ada46d8d96a057514b0aa2a8/core/getopt.ml | ocaml | type action_result =
| ActionDone
| ParameterExpected
| ShowUsage of string option
type option_type =
| Set of bool ref
| Clear of bool ref
| IntVal of int ref
| IntFun of (int -> action_result)
| FloatVal of float ref
| TrivialFun of (unit -> unit)
| SimpleFun of (unit -> action_result)
| String... | |
5e5f55b3c57964c53b0da31f12192487d2febde569b223c20ee2ef36ff2c9a04 | exercism/babashka | example.clj | (ns flatten-array
(:refer-clojure :exclude [flatten]))
(defn flatten [s]
(->> s
(tree-seq sequential? seq)
rest
(remove sequential?)
(remove nil?)))
| null | https://raw.githubusercontent.com/exercism/babashka/707356c52e08490e66cb1b2e63e4f4439d91cf08/exercises/practice/flatten-array/.meta/src/example.clj | clojure | (ns flatten-array
(:refer-clojure :exclude [flatten]))
(defn flatten [s]
(->> s
(tree-seq sequential? seq)
rest
(remove sequential?)
(remove nil?)))
| |
14ad08a79bb1f3c67c951863f880575b1e37c97eacd45f2641f3cc1e9fa13a73 | jcoo092/CML_benchmarks | commstime.rkt | #lang racket/base
(require racket/place)
; Simply sends what it receives. This doesn't need to be a place creator, since it should re-use prefix's place. I think.
(define (ID in out)
((place-channel-put out (place-channel-get in))
(ID in out)))
(define (run-prefix N in out)
(place-channel-put out N)
(ID i... | null | https://raw.githubusercontent.com/jcoo092/CML_benchmarks/05dcab3fce244eff4ce9605df424196d85a73997/Racket/src/commstime.rkt | racket | Simply sends what it receives. This doesn't need to be a place creator, since it should re-use prefix's place. I think.
Sends out an initial value, then behaves as ID
Strictly speaking, this probably should use a wrap combinator so that either channel can be used
actually permit one to sync on a send, which makes... | #lang racket/base
(require racket/place)
(define (ID in out)
((place-channel-put out (place-channel-get in))
(ID in out)))
(define (run-prefix N in out)
(place-channel-put out N)
(ID in out))
(define (place/prefix N in out)
(place/context
c
(run-prefix N in out)))
(define (run-successor in out)
... |
5b758f9906921c423ea5fe6415acd01def76d38195ef001df74f3faed1c0754c | maralorn/haskell-taskwarrior | TaskSpec.hs | # LANGUAGE RecordWildCards #
module TaskSpec (
spec,
) where
import Control.Arrow (second)
import Prelude hiding (id)
import Data.Aeson
import qualified Data.Map.Strict as Map
import Data.Time
import Taskwarrior.Annotation
import Taskwarrior.Mask
import Taskwarrior.Priority
import Taskwarrior.RecurringChild
import... | null | https://raw.githubusercontent.com/maralorn/haskell-taskwarrior/dfd5eea3148b5ef408e5ccd63980f3d49d481bc9/test/TaskSpec.hs | haskell | A task cannot be both a parent and child recurrence
IDs can't be negative, and 0 is used as "not present" | # LANGUAGE RecordWildCards #
module TaskSpec (
spec,
) where
import Control.Arrow (second)
import Prelude hiding (id)
import Data.Aeson
import qualified Data.Map.Strict as Map
import Data.Time
import Taskwarrior.Annotation
import Taskwarrior.Mask
import Taskwarrior.Priority
import Taskwarrior.RecurringChild
import... |
b07c2be1bb694f39490f50bb328629d854043bf72f4292b68601733fec9f5003 | craigl64/clim-ccl | vertical-string.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Package : CLIM - INTERNALS ; Base : 10 ; Lowercase : Yes -*-
(in-package :clim-internals)
"Copyright (c) 1988, 1989, 1990 International Lisp Associates. All rights reserved."
;;; A utility for placing glyphs along a vertical path. Does not do any work yet
to o... | null | https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/pre-silica/vertical-string.lisp | lisp | Syntax : ANSI - Common - Lisp ; Package : CLIM - INTERNALS ; Base : 10 ; Lowercase : Yes -*-
A utility for placing glyphs along a vertical path. Does not do any work yet
but said that could be a " future " .
What kind of font metrics do we get for the rotated font? Do we
the char width for vertical alignment sp... |
(in-package :clim-internals)
"Copyright (c) 1988, 1989, 1990 International Lisp Associates. All rights reserved."
(defun draw-vertical-string* (stream string x y
&key (start 0) end
(align-x ':left) (align-y ':top))
(when (null end) (setq end (length string)))
get " normal " metrics and then r... |
b2b615491129d0e5f78a1a978d8e8aa5a1362bfcf80f90ba123f406edc61d5c6 | immutant/lein-immutant | project.clj | (defproject lein-immutant "2.1.1-SNAPSHOT"
:description "Leiningen plugin for managing an Immutant project."
:url "-immutant"
:mailing-list {:name "Immutant users list"
:post ""
:subscribe ""
:unsubscribe ""}
:license {:name "Eclipse Public License - v 1.0"
... | null | https://raw.githubusercontent.com/immutant/lein-immutant/08cdb67bcb7ae0c72c8a286395125c89b9ca9950/project.clj | clojure | (defproject lein-immutant "2.1.1-SNAPSHOT"
:description "Leiningen plugin for managing an Immutant project."
:url "-immutant"
:mailing-list {:name "Immutant users list"
:post ""
:subscribe ""
:unsubscribe ""}
:license {:name "Eclipse Public License - v 1.0"
... | |
112e7c5628aa13b8a33c305b006b4f6bef71d3a330b850174656e1d60cb3266b | erlangonrails/devdb | riak_core_vnode_master.erl | %% -------------------------------------------------------------------
%%
%% riak_vnode_master: dispatch to vnodes
%%
Copyright ( c ) 2007 - 2010 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
e... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/riak_core/src/riak_core_vnode_master.erl | erlang | -------------------------------------------------------------------
riak_vnode_master: dispatch to vnodes
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for th... | Copyright ( c ) 2007 - 2010 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
... |
5beb1e4d97110f9310326fc6770feca24eb39877e04a1a7ad1d00a27a95e2ee2 | FreeProving/free-compiler | Syntax.hs | -- | This module contains the abstract syntax tree (AST) for the intermediate
-- representation (IR) of the compiler.
--
The intermediate language is very similar to the subset of Haskell
-- supported by the compiler. The main goal is to make the transformations
on the AST and code generation functions easi... | null | https://raw.githubusercontent.com/FreeProving/free-compiler/6931b9ca652a185a92dd824373f092823aea4ea9/src/lib/FreeC/IR/Syntax.hs | haskell | | This module contains the abstract syntax tree (AST) for the intermediate
representation (IR) of the compiler.
supported by the compiler. The main goal is to make the transformations
be distinguished. For example, there is no explicit representation of
infix function applications and no list literals. Th... | The intermediate language is very similar to the subset of Haskell
on the AST and code generation functions easier to comprehend . The IR does
have fewer syntactic constructs than so that fewer cases need to
An additional goal of this AST is to reduce coupling with the parsing
whose AST can be tran... |
73c4981a919da8d93a3ae7c65b167954c6e83ae9aea9a812b7a7e562c7886b4c | ad-si/ulid | Random.hs | | Helper functions to generate the random part of an ULID
-- either with PRNGs or TRNGs.
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
module Data.ULID.Random (
ULIDRandom,
mkCryptoULIDRandom,
mkULIDRandom,
getULIDRandom
) where
import Control.DeepSeq
import Control.Monad
import Cry... | null | https://raw.githubusercontent.com/ad-si/ulid/4826a85af6646a76b28ada48659be856051dab4d/src/Data/ULID/Random.hs | haskell | either with PRNGs or TRNGs.
# LANGUAGE DeriveDataTypeable #
| Generate a `ULIDRandom` based on a cryptographically secure
random number generator.
See:
-api-0.13.3/docs/Crypto-Random.html
| Generate a `ULIDRandom` based on a standard random number generator.
See:
-1.1/docs/System-Random.html
| Generate a ULID ... | | Helper functions to generate the random part of an ULID
# LANGUAGE DeriveGeneric #
module Data.ULID.Random (
ULIDRandom,
mkCryptoULIDRandom,
mkULIDRandom,
getULIDRandom
) where
import Control.DeepSeq
import Control.Monad
import Crypto.Random
import Data.Binary
import Data.Binary.Roll
import Data.B... |
86bb77b0811d0b65be1c78d7d5f95cfb6a018b903b3f68579c44a131d149fb4b | ragkousism/Guix-on-Hurd | services.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2015 , 2016 , 2017 < >
Copyright © 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU 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 F... | null | https://raw.githubusercontent.com/ragkousism/Guix-on-Hurd/e951bb2c0c4961dc6ac2bda8f331b9c4cee0da95/gnu/services.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2015 , 2016 , 2017 < >
Copyright © 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu services)
#:use-module (guix gexp)
#:use-module (g... |
6ac4858b02e82c7db553198a7fbc532350055f4f025c5e6e4287d8db23f4e162 | clojure/core.typed | loop.clj | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;... | null | https://raw.githubusercontent.com/clojure/core.typed/f5b7d00bbb29d09000d7fef7cca5b40416c9fa91/typed/checker.jvm/src/clojure/core/typed/checker/check/special/loop.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns clojure.core.typed.checker.check.special.loop
(:require [clojure.core.typed.checker.jvm.parse-unparse :as prs]
[clojure.core.typed.checker.check.utils :as cu]
[clojure.core.typed.checker.check.recur-utils :as recur-u]
[clojure.core.t... |
8a29a91de840f009f66c16c7e207946b3c1bd3d24d6c5541550b2f758d556264 | deps-app/versions | web_test.clj | (ns jarkeeper.web-test
(:require [clojure.test :refer [deftest testing is]]
[jarkeeper.web :refer [img-status-resp last-modified]]
[ring.util.response :as resp]))
(deftest image-rendering-test
(testing "png image"
(is (= (img-status-resp "public/images/out-of-date.png")
(-> (... | null | https://raw.githubusercontent.com/deps-app/versions/5e58ac456cb3ec90c5d87dbfdde8f9414f8b1f3b/test/jarkeeper/web_test.clj | clojure | (ns jarkeeper.web-test
(:require [clojure.test :refer [deftest testing is]]
[jarkeeper.web :refer [img-status-resp last-modified]]
[ring.util.response :as resp]))
(deftest image-rendering-test
(testing "png image"
(is (= (img-status-resp "public/images/out-of-date.png")
(-> (... | |
a18f29bb851207c89a461e1526874aaf52e554280ffa989915447e3390294cd7 | mentat-collective/emmy | milne.cljc | #_"SPDX-License-Identifier: GPL-3.0"
(ns emmy.numerical.quadrature.milne
(:require [emmy.numerical.quadrature.common :as qc]
[emmy.numerical.quadrature.midpoint :as qm]
[emmy.polynomial.richardson :as pr]
[emmy.util.stream :as us]))
# # Milne 's Rule
;;
This numerical integra... | null | https://raw.githubusercontent.com/mentat-collective/emmy/535b237a8e3fd7067b9c0ade8b2a4b3419f9f132/src/emmy/numerical/quadrature/milne.cljc | clojure |
formula](#Open_Newton%E2%80%93Cotes_formulas);
endpoints!) and combines them into an area estimate for this slice using the
following formula:
point $f_i$ is the point $i$ steps into the window.
the midpoint method (see `midpoint.cljc`), subject to a single refinement
| #_"SPDX-License-Identifier: GPL-3.0"
(ns emmy.numerical.quadrature.milne
(:require [emmy.numerical.quadrature.common :as qc]
[emmy.numerical.quadrature.midpoint :as qm]
[emmy.polynomial.richardson :as pr]
[emmy.util.stream :as us]))
# # Milne 's Rule
This numerical integratio... |
dc29954baecc8a13251bfd19c57d435519056201ced6011dee264157ebe5b1ba | zellige/hs-geojson | LinearRingTests.hs | module Data.LinearRingTests where
-- Local
import Arbitrary ()
import qualified Data.Geospatial.Internal.BasicTypes as BasicTypes
import qualified Data.LinearRing as LinearRing
import qualified Data.List.NonEmpty as ListNonEmpty
import qualified Data.Sequence as Sequence
import qualified Data.Validation as Validation
... | null | https://raw.githubusercontent.com/zellige/hs-geojson/63d89670c5daaa7b5093c6d638e34846a44e0f12/test/Data/LinearRingTests.hs | haskell | Local
Tests
QuickCheck
AccFailure (List too short: (length = 0) :| [])
AccSuccess [0,1,2,4,5,0]
AccSuccess [0,1,2,4,5,0]
> (\x xs -> length (foldrDropLast (:) [] (x : xs)) == length xs) (x :: Int) (xs :: [Int])
| module Data.LinearRingTests where
import Arbitrary ()
import qualified Data.Geospatial.Internal.BasicTypes as BasicTypes
import qualified Data.LinearRing as LinearRing
import qualified Data.List.NonEmpty as ListNonEmpty
import qualified Data.Sequence as Sequence
import qualified Data.Validation as Validation
import Te... |
36784d6a31cc39301e6817723807682f7f5e4c99fc0f61d18873b7d16082d64a | quyse/pekabeaver | Assets.hs | # LANGUAGE OverloadedStrings , TemplateHaskell #
module Assets () where
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import qualified Data.Serialize as S
import Data.Serialize.Text()
import qualified Data.Text as T
import Language.Haskell.TH
import qualified Text.Blaze.Html5 as H
... | null | https://raw.githubusercontent.com/quyse/pekabeaver/f0039fd07de900a64251cae638701c05bc7dc96e/Assets.hs | haskell | # LANGUAGE OverloadedStrings , TemplateHaskell #
module Assets () where
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import qualified Data.Serialize as S
import Data.Serialize.Text()
import qualified Data.Text as T
import Language.Haskell.TH
import qualified Text.Blaze.Html5 as H
... | |
3ac13a652608c7438799fef5000769970ada9b63a5b84e3053e7435a3a5d4cfe | eugmes/imp | Parser.hs | {-# LANGUAGE OverloadedStrings #-}
module IMP.Test.Parser (tests) where
import Test.Tasty
import Test.Tasty.HUnit
import IMP.Parser
import IMP.SourceLoc
import IMP.AST
import Data.Text (Text, unpack)
import Text.Megaparsec
import Data.Char
import Text.Printf
-- | Escape invalid characters in string tst cases so the... | null | https://raw.githubusercontent.com/eugmes/imp/7bee4dcff146e041b0242b9e7054dfec4c04c84f/test/IMP/Test/Parser.hs | haskell | # LANGUAGE OverloadedStrings #
| Escape invalid characters in string tst cases so they lookg better in the
test report. | module IMP.Test.Parser (tests) where
import Test.Tasty
import Test.Tasty.HUnit
import IMP.Parser
import IMP.SourceLoc
import IMP.AST
import Data.Text (Text, unpack)
import Text.Megaparsec
import Data.Char
import Text.Printf
escapeString :: Text -> String
escapeString = concatMap escape . unpack
where
escape c
... |
508e791d4e337aa9b8f44adc98ecfdf43e1309b369d748d8c2e8b9a9512e246e | ziman/idris-py | CodegenPython.hs | # LANGUAGE PatternGuards #
module IRTS.CodegenPython (codegenPython) where
import IRTS.CodegenCommon
import IRTS.Lang hiding (lift)
import IRTS.Simplified
import IRTS.Defunctionalise hiding (lift)
import Idris.Core.TT
import Numeric
import Data.Maybe
import Data.Char
import Data.List
import Data.Ord
import qualified... | null | https://raw.githubusercontent.com/ziman/idris-py/934fddd877afa1c082445c8ee598cd760910709c/src/IRTS/CodegenPython.hs | haskell | for fresh variables
constructor tags
name, args for tail calls
Make the distinction for the humans reading the code
statements
expressions
A code generator for "a" generates:
2. expression that stands for "a" afterwards
and therefore composes into bigger expressions easily,
The idea is that, for example... | # LANGUAGE PatternGuards #
module IRTS.CodegenPython (codegenPython) where
import IRTS.CodegenCommon
import IRTS.Lang hiding (lift)
import IRTS.Simplified
import IRTS.Defunctionalise hiding (lift)
import Idris.Core.TT
import Numeric
import Data.Maybe
import Data.Char
import Data.List
import Data.Ord
import qualified... |
b839c656d8504876014d63c3fe0f792d5c9c2d8299d7d5a20045f90c78a7a643 | samrushing/irken-compiler | t_stdio.scm | ;; -*- Mode: Irken -*-
(include "lib/basis.scm")
(include "lib/map.scm")
(require-ffi 'posix)
(require-ffi 'stdio)
NOTE : stdin / stdout / stderr can not be portably accessed via
the backend , because they are macros , not globals .
;; The problem can be sorta worked around with `fdopen`.
(defmacro fwrite
... | null | https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/ffi/tests/t_stdio.scm | scheme | -*- Mode: Irken -*-
The problem can be sorta worked around with `fdopen`.
; freebsd / macos
open the file in read mode...
and read some data |
(include "lib/basis.scm")
(include "lib/map.scm")
(require-ffi 'posix)
(require-ffi 'stdio)
NOTE : stdin / stdout / stderr can not be portably accessed via
the backend , because they are macros , not globals .
(defmacro fwrite
(fwrite s stream)
-> (stdio/fwrite s 1 (posix/strlen s) stream)
)
(let ((pat... |
bdcd2d51af4e1c111fc742867e8063b4d7e8b5ddbe5110d9616065bb9082f2f0 | jaspervdj/number-six | Identify.hs | --------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
module NumberSix.Handlers.Identify
( handler
) where
--------------------------------------------------------------------------------
import qualified Data.Text as T
----------------------... | null | https://raw.githubusercontent.com/jaspervdj/number-six/1aba681786bd85bd20f79406c681ea581b982cd6/src/NumberSix/Handlers/Identify.hs | haskell | ------------------------------------------------------------------------------
# LANGUAGE OverloadedStrings #
------------------------------------------------------------------------------
------------------------------------------------------------------------------
----------------------------------------------------... | module NumberSix.Handlers.Identify
( handler
) where
import qualified Data.Text as T
import NumberSix.Irc
handler :: UninitializedHandler
handler = makeHandlerWith "Identify" [] initialize
initialize :: Irc ()
initialize = do
nick' <- getNick
realName' <- getRealName
writeM... |
3146c5574186a74cbf54790af6d08941d0c1d51fda3e4f84f61cd32f14d9d374 | RefactoringTools/HaRe | Signature.hs | module LiftToTopLevel.Signature where
to the top level should bring in x and a as parameters ,
and update the signature to include these
and update the signature to include these
-}
foo a = baz
where
baz :: Int
baz = x + a
x = 1
y :: Int -> Int -> Int
y a b = undefined
| null | https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/test/testdata/LiftToToplevel/Signature.hs | haskell | module LiftToTopLevel.Signature where
to the top level should bring in x and a as parameters ,
and update the signature to include these
and update the signature to include these
-}
foo a = baz
where
baz :: Int
baz = x + a
x = 1
y :: Int -> Int -> Int
y a b = undefined
| |
fb65c0f39b810bf8334e5352ecc54f7f995aab3bf4327133047dd4846cecd37e | ds-wizard/engine-backend | List_App_PUT.hs | module Wizard.Api.Handler.Config.List_App_PUT where
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Wizard.Api.Handler.Common
import Wizard.Api.Resource.Config.AppConfigChangeDTO
import Wizard.Api.Resource.Config.AppConfigJM ()
import Wizard.Model.Config.AppConfig
i... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/39d1411252ac15908d3b5af4e06c41bbc6f1c74d/engine-wizard/src/Wizard/Api/Handler/Config/List_App_PUT.hs | haskell | module Wizard.Api.Handler.Config.List_App_PUT where
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Wizard.Api.Handler.Common
import Wizard.Api.Resource.Config.AppConfigChangeDTO
import Wizard.Api.Resource.Config.AppConfigJM ()
import Wizard.Model.Config.AppConfig
i... | |
70f5ae5f9c8e7956ff9c7c589aa8f0d1367a07e87d308a1a02f7fa26c831a66a | fourmolu/fourmolu | Utils.hs | # LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ViewPatterns #
-- | Random utilities used by the code.
module Ormolu.Utils
( RelativePos (..),
attachRelativePos,
combineSrcSpans',
notImplemented,
showOutputable,
splitDocString,
incSpanLine,
... | null | https://raw.githubusercontent.com/fourmolu/fourmolu/f47860f01cb3cac3b973c5df6ecbae48bbb4c295/src/Ormolu/Utils.hs | haskell | # LANGUAGE OverloadedStrings #
| Random utilities used by the code.
| Relative positions in a list.
| Attach 'RelativePos'es to elements of a given list.
| Combine all source spans from the given list.
| Placeholder for things that are not yet implemented.
| Pretty-print an 'GHC.Outputable' thing.
| Split and no... | # LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ViewPatterns #
module Ormolu.Utils
( RelativePos (..),
attachRelativePos,
combineSrcSpans',
notImplemented,
showOutputable,
splitDocString,
incSpanLine,
separatedByBlank,
separatedByBlankNE,
onTheSameLine,
groupBy'... |
ec61d329b541504bc82ea5b467628186b2071d78edf84b9d638e5ebff62bd6a9 | mhkoji/Senn | profile.lisp | (defpackage :hachee.kkc.profile
(:use :cl)
(:export :execute))
(in-package :hachee.kkc.profile)
(defun execute (kkc)
(sb-profile:profile . #.(mapcar #'string
(list :cl
:hachee.kkc
:hachee.kkc.convert... | null | https://raw.githubusercontent.com/mhkoji/Senn/6508e7d2e61a4dd895465de6feb7ede9d1dde82d/hachee/src/kkc/profile.lisp | lisp | (defpackage :hachee.kkc.profile
(:use :cl)
(:export :execute))
(in-package :hachee.kkc.profile)
(defun execute (kkc)
(sb-profile:profile . #.(mapcar #'string
(list :cl
:hachee.kkc
:hachee.kkc.convert... | |
0bbfc740bb0eba17c96e2f37c89ab76a2b7d6f7a21dc426eecda2de2f6af7c77 | cyrus-/relit | utils.ml | let unique_int_state = ref 0
let unique_int () =
unique_int_state := 1 + !unique_int_state;
!unique_int_state
let unique_string () = string_of_int (unique_int ())
let tmp_file () = "relit_tmp_" ^ unique_string ()
let write_file f text =
let out = open_out f in
Printf.fprintf out "%s" text;
flush out;
clo... | null | https://raw.githubusercontent.com/cyrus-/relit/7eb8dcb1d76044d92bbf070a08f8fdcc7df38089/ppx_relit/utils.ml | ocaml | let unique_int_state = ref 0
let unique_int () =
unique_int_state := 1 + !unique_int_state;
!unique_int_state
let unique_string () = string_of_int (unique_int ())
let tmp_file () = "relit_tmp_" ^ unique_string ()
let write_file f text =
let out = open_out f in
Printf.fprintf out "%s" text;
flush out;
clo... | |
5af0704c26f7d13162a0c3b64058b8b687a9fa13f7a9d45d126b3be859de098c | haskell-perf/xml | Space.hs | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE CPP #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
module Main (main) where
import Control.DeepSeq
import qualified Data.Book
import Data.ByteString (ByteString)
import qualifi... | null | https://raw.githubusercontent.com/haskell-perf/xml/2d11ed2a2fd53721429dfcdcf3e3e0aa58c432c7/Space.hs | haskell | # LANGUAGE OverloadedStrings # | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE CPP #
# LANGUAGE LambdaCase #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
module Main (main) where
import Control.DeepSeq
import qualified Data.Book
import Data.ByteString (ByteString)
import qualified Data.ByteString.Lazy
import ... |
b7d9b8435312f9bc1a44083526df24c6a0ec44ac99b74b1ec6015029298d8551 | tolysz/ghcjs-stack | ComponentDeps.hs | -- | Fine-grained package dependencies
--
-- Like many others, this module is meant to be "double-imported":
--
> import Distribution . Client . (
-- > Component
> , ComponentDep
> , ComponentDeps
-- > )
> import qualified Distribution . Client . as CD
# LANGUAGE CPP #
# LANGUAGE DeriveFunctor #
#... | null | https://raw.githubusercontent.com/tolysz/ghcjs-stack/83d5be83e87286d984e89635d5926702c55b9f29/special/cabal/cabal-install/Distribution/Client/ComponentDeps.hs | haskell | | Fine-grained package dependencies
Like many others, this module is meant to be "double-imported":
> Component
> )
* Fine-grained package dependencies
opaque
** Deconstructing ComponentDeps
------------------------------------------------------------------------------
Types
---------------------------... | > import Distribution . Client . (
> , ComponentDep
> , ComponentDeps
> import qualified Distribution . Client . as CD
# LANGUAGE CPP #
# LANGUAGE DeriveFunctor #
# LANGUAGE DeriveGeneric #
module Distribution.Client.ComponentDeps (
Component(..)
, ComponentDep
* * Constructing ComponentDeps
,... |
2d7de120385267f5b76c6e7b665c92274bce031957d541edbd149f52c1bed87b | dgtized/shimmers | figwheel_runner.cljs | (ns ^:figwheel-hooks shimmers.figwheel-runner
(:require
[cljs-test-display.core :as td]
[figwheel.main.testing :refer-macros [run-tests]]
[fipp.edn :as fedn]
;; load namespaces to test
[shimmers.test-namespaces]))
(enable-console-print!)
(defn prettier [content]
(td/n :pre {}
(td/n :code {}... | null | https://raw.githubusercontent.com/dgtized/shimmers/f096c20d7ebcb9796c7830efcd7e3f24767a46db/test/shimmers/figwheel_runner.cljs | clojure | load namespaces to test
to view, visit :9500/figwheel-extra-main/tests | (ns ^:figwheel-hooks shimmers.figwheel-runner
(:require
[cljs-test-display.core :as td]
[figwheel.main.testing :refer-macros [run-tests]]
[fipp.edn :as fedn]
[shimmers.test-namespaces]))
(enable-console-print!)
(defn prettier [content]
(td/n :pre {}
(td/n :code {} (with-out-str (fedn/pprint co... |
0ab009be13debf6e01d22fc7e9b93d63566b2cb34906098d0f49d7732e8c2b00 | music-suite/music-score | Data.hs |
# LANGUAGE CPP #
module Music.Score.Internal.Data (getData) where
#ifndef GHCI
#define GET_DATA_FILE Paths_music_score.getDataFileName
import qualified Paths_music_score
#else
#define GET_DATA_FILE (return . ("../music-score/"++))
#endif
import qualified System.IO.Unsafe
import qualified Data.ByteString.Lazy
import... | null | https://raw.githubusercontent.com/music-suite/music-score/aa7182d8ded25c03a56b83941fc625123a7931f8/src/Music/Score/Internal/Data.hs | haskell | | Get data from a fixed data file |
# LANGUAGE CPP #
module Music.Score.Internal.Data (getData) where
#ifndef GHCI
#define GET_DATA_FILE Paths_music_score.getDataFileName
import qualified Paths_music_score
#else
#define GET_DATA_FILE (return . ("../music-score/"++))
#endif
import qualified System.IO.Unsafe
import qualified Data.ByteString.Lazy
import... |
ca4308f8b541197ea40563083abf03785697aa98839d4d15a976860a7310cba8 | byulparan/cl-collider | SLUGens.lisp | (in-package #:sc)
(defugen (sort-buf "SortBuf")
(&optional (bufnum 0.0) (sortrate 10.0) (reset 0.0))
((:ar (multinew new 'ugen bufnum sortrate reset))))
(defugen (gravity-grid "GravityGrid")
(&optional (reset 0.0) (rate 0.1) (newx 0.0) (newy 0.0) bufnum (mul 1.0) (add 0.0))
((:ar (madd (multinew new 'ugen... | null | https://raw.githubusercontent.com/byulparan/cl-collider/1ad7f59c36acb61987e65973b77c5deb180285b1/ugens/SC3plugins/SLUGens.lisp | lisp | (in-package #:sc)
(defugen (sort-buf "SortBuf")
(&optional (bufnum 0.0) (sortrate 10.0) (reset 0.0))
((:ar (multinew new 'ugen bufnum sortrate reset))))
(defugen (gravity-grid "GravityGrid")
(&optional (reset 0.0) (rate 0.1) (newx 0.0) (newy 0.0) bufnum (mul 1.0) (add 0.0))
((:ar (madd (multinew new 'ugen... | |
2ae5a5446360642bd9f593eb5ef6dfe97d83f9bef5c7c9519913f566a9d913b0 | kframework/haskell-core-semantics | Disequality.hs | # LANGUAGE NoImplicitPrelude #
module Disequality where
import qualified Prelude as P
result = 1 P.== 2
| null | https://raw.githubusercontent.com/kframework/haskell-core-semantics/6dc257b34993970873cf0ea47f29b3d4fad13b1f/test/haskell/Disequality.hs | haskell | # LANGUAGE NoImplicitPrelude #
module Disequality where
import qualified Prelude as P
result = 1 P.== 2
| |
1f7da488903eb95e970569fb9ed48a8efc1d7196f8abeb77e406a444031babdf | avsm/platform | targets.ml |
* Copyright ( c ) 2016 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/odoc.1.4.2/src/html/targets.ml | ocaml | FIXME: reuse [Url] somehow.
FIXME: reuse [Url] somehow. |
* Copyright ( c ) 2016 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... |
2d06d604841d1e136409ba4e0c4bc2ee5b30bff99ee05c649fb1a32d8c6b88ca | may-liu/qtalk | mod_carboncopy.erl | %%%----------------------------------------------------------------------
%%% File : mod_carboncopy.erl
Author : < >
Purpose : Message Carbons XEP-0280 0.8
Created : 5 May 2008 by < >
%%% Usage : Add the following line in modules section of ejabberd.yml:
%%% {mod_carboncopy, []}
%%%
%%%
... | null | https://raw.githubusercontent.com/may-liu/qtalk/f5431e5a7123975e9656e7ab239e674ce33713cd/qtalk_opensource/src/mod_carboncopy.erl | erlang | ----------------------------------------------------------------------
File : mod_carboncopy.erl
Usage : Add the following line in modules section of ejabberd.yml:
{mod_carboncopy, []}
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.... | Author : < >
Purpose : Message Carbons XEP-0280 0.8
Created : 5 May 2008 by < >
ejabberd , Copyright ( C ) 2002 - 2014 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of... |
c2d83c0a5db7c0192af28c90a33c544b5f4c2850fac92592dca888f2ab6c3a05 | WormBase/wormbase_rest | human_diseases.clj | (ns rest-api.classes.transgene.widgets.human-diseases
(:require
[datomic.api :as d]
[pseudoace.utils :as pace-utils]
[rest-api.classes.do-term.core :as do-term]
[rest-api.classes.generic-fields :as generic]
[rest-api.formatters.object :as obj :refer [pack-obj]]))
(defn detailed-disease-model [transgen... | null | https://raw.githubusercontent.com/WormBase/wormbase_rest/e51026f35b87d96260b62ddb5458a81ee911bf3a/src/rest_api/classes/transgene/widgets/human_diseases.clj | clojure | (ns rest-api.classes.transgene.widgets.human-diseases
(:require
[datomic.api :as d]
[pseudoace.utils :as pace-utils]
[rest-api.classes.do-term.core :as do-term]
[rest-api.classes.generic-fields :as generic]
[rest-api.formatters.object :as obj :refer [pack-obj]]))
(defn detailed-disease-model [transgen... | |
3531724e66f10f1b06794df0ede162bb3416257eb6d96665def44ca4bb81ec10 | finnishtransportagency/harja | paivystystarkistukset.clj | (ns harja.palvelin.ajastetut-tehtavat.paivystystarkistukset
(:require [taoensso.timbre :as log]
[chime :refer [chime-ch]]
[chime :refer [chime-at]]
[com.stuartsierra.component :as component]
[harja.kyselyt.yhteyshenkilot :as yhteyshenkilot-q]
[harja.palvelin... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/9e9e2e75ce8384d2f2705407d6fc2cc68948c1cb/src/clj/harja/palvelin/ajastetut_tehtavat/paivystystarkistukset.clj | clojure | (ns harja.palvelin.ajastetut-tehtavat.paivystystarkistukset
(:require [taoensso.timbre :as log]
[chime :refer [chime-ch]]
[chime :refer [chime-at]]
[com.stuartsierra.component :as component]
[harja.kyselyt.yhteyshenkilot :as yhteyshenkilot-q]
[harja.palvelin... | |
0894ac7183930a595201340ae6b20e0438359860d9b96465d9a2bce83dfd5604 | Andromedans/andromeda | eqchk_pattern.ml | (** Types describing patterns that we can match against. These are simple and do not
bother matching anything under an abstraction (as that is acutally quite tricky). *)
open Eqchk_common
exception Match_fail
module MetaMap =
Map.Make
(struct
type t = int
let compare = Stdlib.compare
end)
... | null | https://raw.githubusercontent.com/Andromedans/andromeda/a5c678450e6c6d4a7cd5eee1196bde558541b994/src/equality/eqchk_pattern.ml | ocaml | * Types describing patterns that we can match against. These are simple and do not
bother matching anything under an abstraction (as that is acutally quite tricky).
* The [collect_XYZ] functions provide low-level functionality for matching a judgement against
a pattern. They collect the values of meta-variable... |
open Eqchk_common
exception Match_fail
module MetaMap =
Map.Make
(struct
type t = int
let compare = Stdlib.compare
end)
let add_meta = MetaMap.add
let add_bound atm bounds = BoundMap.(add atm (cardinal bounds) bounds)
let find_bound = BoundMap.find_opt
* that the [ abstr ] equals the abstr... |
6fae7338f7990b9342b12ada59e33cfdec96ef193247a8cda891f8bf741c2bf9 | foreverbell/project-euler-solutions | 443.hs |
import Control.Arrow (first)
import System.Random (mkStdGen)
import Common.Numbers.Primes (factorize, toDivisors)
solve :: Int -> Int
solve n = n + 2 * k
where
k = fst . last $ takeWhile (\(a, _) -> a <= n) p3
p3 = (20, mkStdGen 23) : map next p3
next (n, g) = (n + k, g0)
where
(ds, g0) =... | null | https://raw.githubusercontent.com/foreverbell/project-euler-solutions/c0bf2746aafce9be510892814e2d03e20738bf2b/src/443.hs | haskell |
import Control.Arrow (first)
import System.Random (mkStdGen)
import Common.Numbers.Primes (factorize, toDivisors)
solve :: Int -> Int
solve n = n + 2 * k
where
k = fst . last $ takeWhile (\(a, _) -> a <= n) p3
p3 = (20, mkStdGen 23) : map next p3
next (n, g) = (n + k, g0)
where
(ds, g0) =... | |
7ba03eab03af4c0ace4ac0abcf38dc83a4ac5867cbce61820f3926dfee77bd03 | racket/gui | keycode.rkt | #lang racket/base
(provide map-key-code
key-symbol-to-menu-key)
(define (map-key-code v)
(hash-ref
#hash((#xff08 . #\backspace)
(#xffff . #\rubout)
(#xff09 . #\tab)
(#xfe20 . #\tab) ; left tab (sometimes from ctl-shift-tab)
(#xff0a . #\newline)
(#xff0d . #\re... | null | https://raw.githubusercontent.com/racket/gui/d1fef7a43a482c0fdd5672be9a6e713f16d8be5c/gui-lib/mred/private/wx/gtk/keycode.rkt | racket | left tab (sometimes from ctl-shift-tab)
escape
was #\u3 in earlier versions | #lang racket/base
(provide map-key-code
key-symbol-to-menu-key)
(define (map-key-code v)
(hash-ref
#hash((#xff08 . #\backspace)
(#xffff . #\rubout)
(#xff09 . #\tab)
(#xff0a . #\newline)
(#xff0d . #\return)
(#xff50 . home)
(#xff51 . left)
(#x... |
9e37c733454fe529a90d4adac477b29e6859468654b3feb6eb61c3464d686b0c | spurious/chibi-scheme-mirror | string-tests.scm |
(cond-expand
(modules (import (only (chibi test) test-begin test test-end)
(chibi string)))
(else #f))
(test-begin "strings")
(test #t (string-null? ""))
(test #f (string-null? " "))
(test #t (string-every char-alphabetic? "abc"))
(test #f (string-every char-alphabetic? "abc0"))
(test #f (string... | null | https://raw.githubusercontent.com/spurious/chibi-scheme-mirror/49168ab073f64a95c834b5f584a9aaea3469594d/tests/string-tests.scm | scheme |
(cond-expand
(modules (import (only (chibi test) test-begin test test-end)
(chibi string)))
(else #f))
(test-begin "strings")
(test #t (string-null? ""))
(test #f (string-null? " "))
(test #t (string-every char-alphabetic? "abc"))
(test #f (string-every char-alphabetic? "abc0"))
(test #f (string... | |
e7bd707a88a13735f7ae2d7fbd5b86e3acf97d15bad44091a170bb8b521991ab | fortytools/holumbus | IndexSchema.hs | {-# LANGUAGE OverloadedStrings #-}
module Hayoo.Hunt.IndexSchema
where
import Control.Applicative ()
import Control.Monad.IO.Class
import Data.Text (Text, pack, unpack)
import Data.Time
import Hayoo.Hunt.Output
import Hayoo.IndexConfig
imp... | null | https://raw.githubusercontent.com/fortytools/holumbus/4b2f7b832feab2715a4d48be0b07dca018eaa8e8/Hayoo/HayooIndexer/Hayoo/Hunt/IndexSchema.hs | haskell | # LANGUAGE OverloadedStrings #
------------------------------------------------------------
the context names
c'normalized,
c'subnorm,
c'normalized = "normalized"
the haddock contexts
the hackage package contexts
$ is the old, \n the new delimiter
------------------------------------------------------------
... |
module Hayoo.Hunt.IndexSchema
where
import Control.Applicative ()
import Control.Monad.IO.Class
import Data.Text (Text, pack, unpack)
import Data.Time
import Hayoo.Hunt.Output
import Hayoo.IndexConfig
import Hunt.ClientInterface
... |
ccb550f0422acf2f029b6b6f51fe1fef0675b6ef675259ded8c916dadf198b88 | goldfirere/singletons | T489.hs | module T489 where
import Data.Singletons.Base.TH
import Prelude.Singletons
$(singletons [d|
blah :: Maybe a -> [a]
blah (Just @a x) = [x :: a]
blah (Nothing @a) = [] :: [a]
flurmp :: Maybe () -> ()
flurmp (Nothing @_) = ()
flurmp (Just ()) = ()
|])
| null | https://raw.githubusercontent.com/goldfirere/singletons/9c9622de92760889f0470af9d6c0cca89b83c2d0/singletons-base/tests/compile-and-dump/Singletons/T489.hs | haskell | module T489 where
import Data.Singletons.Base.TH
import Prelude.Singletons
$(singletons [d|
blah :: Maybe a -> [a]
blah (Just @a x) = [x :: a]
blah (Nothing @a) = [] :: [a]
flurmp :: Maybe () -> ()
flurmp (Nothing @_) = ()
flurmp (Just ()) = ()
|])
| |
284c36c73c81ff278630415521a9568ccd322b2f81017cae0ae504b0191f4da4 | afainer/cleven | foreign.lisp | Copyright ( c ) 2015 - 2016 , < >
;;;
;;; Permission is hereby granted, free of charge, to any person obtaining
;;; a copy of this software and associated documentation files (the
" Software " ) , to deal in the Software without restriction , including
;;; without limitation the rights to use, copy, modify, merg... | null | https://raw.githubusercontent.com/afainer/cleven/24e3102f01c4f18152b2618c994aa7b6a7598755/foreign.lisp | lisp |
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
without limitation the rights to use, copy, modify, merge, publish,
the following conditions:
The above copyright notice and this permission notice shall be
EXPRESS OR IMPLIED, ... | Copyright ( c ) 2015 - 2016 , < >
" Software " ) , to deal in the Software without restriction , including
distribute , sublicense , and/or sell copies of the Software , and to
permit persons to whom the Software is furnished to do so , subject to
included in all copies or substantial portions of the Softw... |
ef9d3006d3edb4d80863c82957093b432c12daa303a7f9600b2d1bce16cc8066 | philipcristiano/etsdb | etsdb_graphite_protocol.erl | -module(etsdb_graphite_protocol).
-behaviour(ranch_protocol).
-export([start_link/4]).
-export([init/4]).
start_link(Ref, Socket, Transport, Opts) ->
Pid = spawn_link(?MODULE, init, [Ref, Socket, Transport, Opts]),
{ok, Pid}.
init(Ref, Socket, Transport, _Opts = []) ->
ok = ranch:accept_ack(Ref),
loop(Socket, Tr... | null | https://raw.githubusercontent.com/philipcristiano/etsdb/f1c0d1d8baff8666d55a1f30e77a40652d173826/src/etsdb_graphite_protocol.erl | erlang | -module(etsdb_graphite_protocol).
-behaviour(ranch_protocol).
-export([start_link/4]).
-export([init/4]).
start_link(Ref, Socket, Transport, Opts) ->
Pid = spawn_link(?MODULE, init, [Ref, Socket, Transport, Opts]),
{ok, Pid}.
init(Ref, Socket, Transport, _Opts = []) ->
ok = ranch:accept_ack(Ref),
loop(Socket, Tr... | |
fd90251f95051e294af86c8b8a0d768e18b57ab064d5dd19b47bc8c9bdce8ede | privet-kitty/cl-competitive | logreverse.lisp | ;;;
;;; Bit-reversal operation
Reference :
;;;
(defpackage :cp/logreverse
(:use :cl)
(:export #:logreverse))
(in-package :cp/logreverse)
(sb-ext:define-load-time-global *bit-reverse-table*
(make-array 65536 :element-type '(unsigned-byte 16)))
(declaim ((simple-array (unsigned-byte 16) (65536)) *bit-reverse-t... | null | https://raw.githubusercontent.com/privet-kitty/cl-competitive/4d1c601ff42b10773a5d0c5989b1234da5bb98b6/module/logreverse.lisp | lisp |
Bit-reversal operation
Below is a somewhat slower but space efficient bit-reversal
(declaim (inline logreverse))
"Returns the bit-reversal in the range [0, SIZE) of X."
((integer 0 64) size))
(if (<= size 8)
(- size 8))
(setq x (logior (ash (logand x #xf0f0f0f0f0f0f0f0) -4)
... | Reference :
(defpackage :cp/logreverse
(:use :cl)
(:export #:logreverse))
(in-package :cp/logreverse)
(sb-ext:define-load-time-global *bit-reverse-table*
(make-array 65536 :element-type '(unsigned-byte 16)))
(declaim ((simple-array (unsigned-byte 16) (65536)) *bit-reverse-table*))
(dotimes (idx (length *bit... |
f58d375395a7f7ed7a97dbab08904b891be4be0094172fe01d8135e0b289cb4c | xapi-project/message-switch | lvm.ml |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... | null | https://raw.githubusercontent.com/xapi-project/message-switch/bd10e096c56f149d6cb0831a520a84843ebca300/xapi-storage-script/examples/volume/org.xen.xcp.storage.plainlvm/lvm.ml | ocaml | /dev/loop0: [fd00]:1973802 (/tmp/SR.createc04251volume)
Check it's not already the correct size
Returns something of the form: " 40.00M\n"
ignore the decimals
get rid of whitespace
... and it should be a number |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... |
b5b7f88394691797538cfc606ecfe27e627041bac4f4c0dc9a454307b567fb92 | jiangpengnju/htdp2e | programming_with_structures_sample_Dot.v1.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname programming_with_structures_sample_Dot) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t ... | null | https://raw.githubusercontent.com/jiangpengnju/htdp2e/d41555519fbb378330f75c88141f72b00a9ab1d3/fixed-size-data/adding-structure/programming_with_structures_sample_Dot.v1.rkt | racket | about the language level of this file in a form that our tools can easily process.
Sample problem: Your team is designing an interactive game program that moves
place the dot. Together you chose Posn as the data representation for the
game state. Here is how far you got:
visual constants
The state of the world is... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname programming_with_structures_sample_Dot) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
a red dot across a 100 x 100 ca... |
c0c8db892136a838430351c824250b2520d2df2ebfda9ffbceb3d9933994df3b | ZHaskell/z-data | NumericSpec.hs | # LANGUAGE TypeApplications #
# LANGUAGE ScopedTypeVariables #
module Z.Data.Parser.NumericSpec where
import qualified Data.List as L
import Data.Word
import Data.Int
import GHC.Float
import Text.Printf (printf)
import qualified Z.Data.Parser.Nume... | null | https://raw.githubusercontent.com/ZHaskell/z-data/b547ac196db274e754af9fdda736ff6beb4c98fa/test/Z/Data/Parser/NumericSpec.hs | haskell | # LANGUAGE TypeApplications #
# LANGUAGE ScopedTypeVariables #
module Z.Data.Parser.NumericSpec where
import qualified Data.List as L
import Data.Word
import Data.Int
import GHC.Float
import Text.Printf (printf)
import qualified Z.Data.Parser.Nume... | |
6c9bede0725d5207e49f9ab5dc02856e82e83049aea34de9f7258b43a85f41ce | overtone/overtone | smoke_test.clj | (ns overtone.smoke-test
"Simple tests which exercise overtone and make few assertions.
Ensures successful complilation of overtone and its examples."
(:require [overtone.config.log :as log]
[bultitude.core :as b])
(:use overtone.core
clojure.test
test-helper))
(comment
;; Use a si... | null | https://raw.githubusercontent.com/overtone/overtone/02f8cdd2817bf810ff390b6f91d3e84d61afcc85/test/overtone/smoke_test.clj | clojure | Use a single internal server for all tests in this ns.
Wait for all osc messages to be processed before moving on.
Trigger a synchronous reset to cleanup after each test
Examples
Create a test for each example ns under `overtone.examples.*` which
loads the ns and invokes the `-main` fn if it exists and logs *out... | (ns overtone.smoke-test
"Simple tests which exercise overtone and make few assertions.
Ensures successful complilation of overtone and its examples."
(:require [overtone.config.log :as log]
[bultitude.core :as b])
(:use overtone.core
clojure.test
test-helper))
(comment
(use-fixtur... |
6996e58d0626566e31212da9f2b2f6a6e48ba95646236b7fb7847df33f60dfbe | kouphax/flic | groups.clj | (ns flic.groups)
; defining groups of users
(def ^:private groups
(atom { }))
(defn define-group
"defines a rule for identifiying groups of users"
[group predicate-fn]
(swap! groups merge { (keyword group) predicate-fn }))
(defn define-groups
"defines all groups in a single statement"
[all-groups]
(sw... | null | https://raw.githubusercontent.com/kouphax/flic/f94b686afe2bcceefa1af0dbe90050bc43bd7a7c/src/flic/groups.clj | clojure | defining groups of users | (ns flic.groups)
(def ^:private groups
(atom { }))
(defn define-group
"defines a rule for identifiying groups of users"
[group predicate-fn]
(swap! groups merge { (keyword group) predicate-fn }))
(defn define-groups
"defines all groups in a single statement"
[all-groups]
(swap! groups (fn [_] all-grou... |
cf4cdbbb4108c83b24bdedbdcfad6685c89454c711cdb5f5b87456dbb2963f70 | ulisesmac/Horarios-FC-UNAM | requesting_data.cljs | (ns horarios-fc.components.requesting-data
(:require
[horarios-fc.colors :refer [theme]]
[re-frame.core :as rf]
[react-native :as rn]))
(defn requesting-data []
(let [requesting-data? (rf/subscribe [:requesting-data?])]
(fn []
(when @requesting-data?
[rn/view {:style {:position :absolute... | null | https://raw.githubusercontent.com/ulisesmac/Horarios-FC-UNAM/425c84e44602b97deba48091459a6c1eb7ad1767/src/horarios_fc/components/requesting_data.cljs | clojure | (ns horarios-fc.components.requesting-data
(:require
[horarios-fc.colors :refer [theme]]
[re-frame.core :as rf]
[react-native :as rn]))
(defn requesting-data []
(let [requesting-data? (rf/subscribe [:requesting-data?])]
(fn []
(when @requesting-data?
[rn/view {:style {:position :absolute... | |
e451670212238781d12f8fc918d40defb8b80234e7f4ec8974c7fa5ce5debb32 | klutometis/clrs | 9-2c.scm | (require-extension syntax-case check)
(require '../9/chapter)
(import* chapter-9
weighted-median-with-select
elt-weights)
(check (weighted-median-with-select elt-weights) => 7)
| null | https://raw.githubusercontent.com/klutometis/clrs/f85a8f0036f0946c9e64dde3259a19acc62b74a1/9/9-2c.scm | scheme | (require-extension syntax-case check)
(require '../9/chapter)
(import* chapter-9
weighted-median-with-select
elt-weights)
(check (weighted-median-with-select elt-weights) => 7)
| |
bcda075d4a4bfb2d588104b072b0bcd67c9dbcdc8b65d36c9c3708bd06ad62d6 | erlangonrails/devdb | onecached_app.erl | %%%----------------------------------------------------------------------
OneCached ( c ) 2007 Process - one ( -one.net/ )
$ Id$
%%%----------------------------------------------------------------------
-module(onecached_app).
-author('').
-vsn('$Revision$ ').
% Start the OneCached application
-behaviour(applica... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/OneCached/src/onecached_app.erl | erlang | ----------------------------------------------------------------------
----------------------------------------------------------------------
Start the OneCached application | OneCached ( c ) 2007 Process - one ( -one.net/ )
$ Id$
-module(onecached_app).
-author('').
-vsn('$Revision$ ').
-behaviour(application).
-export([start/2,
stop/1
]).
start(normal, _Args) ->
onecached_sup:start_link().
stop(_Args) ->
ok.
|
9269eaaeb3e3b8860fd0be852042a22f8b741cb1e255bc006c1c28df9c9e0cde | jjtolton/rocinante | notify.cljs | (ns {{base}}.lib.events.notify
(:require [{{base}}.lib.utils :as utils]))
(defn event! [e]
{:notify [{:event (utils/event e)
:data (utils/event-data e)}]})
| null | https://raw.githubusercontent.com/jjtolton/rocinante/625b1c5309b7f01d9f48af8d4df8f55b1ee97158/src/clj/new/rocinante/src/cljs/base/lib/events/notify.cljs | clojure | (ns {{base}}.lib.events.notify
(:require [{{base}}.lib.utils :as utils]))
(defn event! [e]
{:notify [{:event (utils/event e)
:data (utils/event-data e)}]})
| |
81d4ca1bd508dec79b68eb547618da59ecf69f8fed6dae1c41a96f111afa2cd4 | ethereum/act | Print.hs | {-# Language GADTs #-}
{-# Language DataKinds #-}
module Print where
import Prelude hiding (GT, LT)
import Data.ByteString.UTF8 (toString)
import Data.List
import Syntax
import Syntax.TimeAgnostic
prettyBehaviour :: Behaviour t -> String
prettyBehaviour (Behaviour name _ contract interface preconditions postcondi... | null | https://raw.githubusercontent.com/ethereum/act/36b65b71eea22ebe4287f066190ecf47f4394fa3/src/Print.hs | haskell | # Language GADTs #
# Language DataKinds #
booleans
integers
bytestrings
polymorphic
| Invariant predicates are represented internally as a pair of timed
since it keeps untimed expressions away from the various backends, and
maintains a nice seperation between the various compilation passes, but
unfortunately req... |
module Print where
import Prelude hiding (GT, LT)
import Data.ByteString.UTF8 (toString)
import Data.List
import Syntax
import Syntax.TimeAgnostic
prettyBehaviour :: Behaviour t -> String
prettyBehaviour (Behaviour name _ contract interface preconditions postconditions stateUpdates returns)
= "behaviour " <> ... |
baad29ffceae7631067d211c04653bb96a3cc78129f9e31b3678763bfc8204ce | wdebeaum/step | unaware.lisp | (define-words :pos W::adj
:words (
(w::unaware
(SENSES
((meta-data :origin adjective-reorganization :entry-date 20170403 :change-date nil :comments nil :wn nil :comlex nil)
(templ adj-central-figure-ground-optional-templ (XP (% W::PP (W::ptype W::of))))
(lf-parent ont::not-aware-val)
)
)
... | null | https://raw.githubusercontent.com/wdebeaum/step/f38c07d9cd3a58d0e0183159d4445de9a0eafe26/src/LexiconManager/Data/new/unaware.lisp | lisp | (define-words :pos W::adj
:words (
(w::unaware
(SENSES
((meta-data :origin adjective-reorganization :entry-date 20170403 :change-date nil :comments nil :wn nil :comlex nil)
(templ adj-central-figure-ground-optional-templ (XP (% W::PP (W::ptype W::of))))
(lf-parent ont::not-aware-val)
)
)
... | |
8b66e159a70089e02d41dec19b68e5f185886435b25b990789e04278ea8346da | dstarcev/stepic-haskell | Task20.hs | module Module5.Task20 where
import Control.Monad.State (State, state)
import Control.Monad.Reader (Reader, runReader)
readerToState :: Reader r a -> State r a
readerToState m = state $ \e -> (runReader m e, e)
| null | https://raw.githubusercontent.com/dstarcev/stepic-haskell/6a8cf4b3cc17333ac4175e825db57dbe151ebae0/src/Module5/Task20.hs | haskell | module Module5.Task20 where
import Control.Monad.State (State, state)
import Control.Monad.Reader (Reader, runReader)
readerToState :: Reader r a -> State r a
readerToState m = state $ \e -> (runReader m e, e)
| |
7cea6a4fb32094e2d15faf96c1900d6928b664c9471c2293cc6510695130de1c | raymoo/NEET | Species.hs |
Copyright ( C ) 2015
This program is free software ; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 3
of the License , or ( at your option ) any later version .
This program is distributed in the ho... | null | https://raw.githubusercontent.com/raymoo/NEET/4e1986a31f6e269bd94dc0e73939d455ce876a9b/src/Neet/Species.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE RankNTypes #
* Construction
* Update/Fitness
* Statistics
* Debugging
| A NEAT Species.
^ All the organisms in this species
^ Number of gens ago the best score improved
| Scoring data
| A result of evaluating a species
^ The score of each organism
^ Result 'SpecScore'
^ ... |
Copyright ( C ) 2015
This program is free software ; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 3
of the License , or ( at your option ) any later version .
This program is distributed in the ho... |
90ffa6d022f43dbcf6f950980401b096ecf7763437023d15ade07465b0c5f755 | ssor/erlangDemos | sc_element.erl | -module(sc_element).
-behaviour(gen_server).
-export([
start_link/2,
create/1,
create/2,
fetch/1,
replace/2,
delete/1
]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-define(SERVER, ?MODULE).
-defi... | null | https://raw.githubusercontent.com/ssor/erlangDemos/632cd905be2c4f275f1c1ae15238e711d7bb9147/erlware-Erlang-and-OTP-in-Action-Source/chapter_09/simple_cache/src/sc_element.erl | erlang | -module(sc_element).
-behaviour(gen_server).
-export([
start_link/2,
create/1,
create/2,
fetch/1,
replace/2,
delete/1
]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-define(SERVER, ?MODULE).
-defi... | |
2c752f841e5e14b78bb0cff5ca42f232c8a3a835aea33527ed24e7df24e555b5 | cedlemo/OCaml-GI-ctypes-bindings-generator | Subprocess.ml | open Ctypes
open Foreign
type t = unit ptr
let t_typ : t typ = ptr void
(*Not implemented g_subprocess_newv type C Array type for Types.Array tag not implemented*)
let communicate self stdin_buf cancellable =
let communicate_raw =
foreign "g_subprocess_communicate" (t_typ @-> ptr_opt Bytes.t_typ @-> ptr_opt Can... | null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gio/Subprocess.ml | ocaml | Not implemented g_subprocess_newv type C Array type for Types.Array tag not implemented
Not implemented g_subprocess_communicate_async type callback not implemented
Not implemented g_subprocess_communicate_finish type interface not implemented
Not implemented g_subprocess_communicate_utf8_async type callback not implem... | open Ctypes
open Foreign
type t = unit ptr
let t_typ : t typ = ptr void
let communicate self stdin_buf cancellable =
let communicate_raw =
foreign "g_subprocess_communicate" (t_typ @-> ptr_opt Bytes.t_typ @-> ptr_opt Cancellable.t_typ @-> ptr (ptr_opt Bytes.t_typ) @-> ptr (ptr_opt Bytes.t_typ) @-> ptr (ptr_opt ... |
0f5abb6afcf978bdef0c6b13fb35e4f2e1e849eecdb4285739a179b4d3bb1377 | jrwdunham/tegere | grammar.clj | (ns tegere.grammar
"This namespace contains Instaparse CFG (or PEG) grammars (and parsers derived
therefrom) that are used by TeGere. The primary grammar is ``feature-prsr``,
which describes Gherkin feature files. However, PSGs are also used to parse the
tag expressions that may be passed at the command line, h... | null | https://raw.githubusercontent.com/jrwdunham/tegere/ee05eec87419d7d4cf91aebd2da121225bb8b3eb/src/tegere/grammar.clj | clojure | "so" means "Scenario Outline". Steps in a scenario outline must be able to
recognize variable references between angle brackets, e.g.,
"Given a <modifier> chimpanzee".
==============================================================================
"Old-style" tag expression grammar
================================... | (ns tegere.grammar
"This namespace contains Instaparse CFG (or PEG) grammars (and parsers derived
therefrom) that are used by TeGere. The primary grammar is ``feature-prsr``,
which describes Gherkin feature files. However, PSGs are also used to parse the
tag expressions that may be passed at the command line, h... |
1fce2a26e6af5887d7fff45ead680aa0481d2ab2321709bd7e447aa825033e61 | ku-fpg/hermit | Main.hs |
collatz :: Integer -> Integer
collatz n | even n = n `div` 2
| odd n = 3 * n + 1
chop :: [Integer] -> [Integer]
chop (x:xs) = x : if x == 1 then [] else chop xs
chain :: Integer -> [Integer]
chain = chop . iterate collatz
# RULES " map ! ! " forall f xs n . map f xs ! ! n = f ( xs ! ! n ) #
{-# RULES "... | null | https://raw.githubusercontent.com/ku-fpg/hermit/3e7be430fae74a9e3860b8b574f36efbf9648dec/examples/collatz/Main.hs | haskell | # RULES "!! [n..]" forall n x . [n..] !! x = x + n #
ww : [[Integer]] ~~> Map Int [Integer] |
collatz :: Integer -> Integer
collatz n | even n = n `div` 2
| odd n = 3 * n + 1
chop :: [Integer] -> [Integer]
chop (x:xs) = x : if x == 1 then [] else chop xs
chain :: Integer -> [Integer]
chain = chop . iterate collatz
# RULES " map ! ! " forall f xs n . map f xs ! ! n = f ( xs ! ! n ) #
chains ::... |
ba3edf0384ede65d10ce2f9f83c75bf22c17dcb9f052c374554bd7283802c64a | goldfirere/singletons | T229.hs | module T229 where
import Data.Singletons.Base.TH
$(singletons [d| ___foo :: Bool -> Bool
___foo _ = True |])
| null | https://raw.githubusercontent.com/goldfirere/singletons/70d622645b960d60411ab8f31d16ffb91e69379e/singletons-base/tests/compile-and-dump/Singletons/T229.hs | haskell | module T229 where
import Data.Singletons.Base.TH
$(singletons [d| ___foo :: Bool -> Bool
___foo _ = True |])
| |
3fb41fe1c0508ede227178d4fa5a437ce7feeb1a3ed7fdc1f1054cea055e2bd4 | fortytools/holumbus | URIs.hs | # OPTIONS #
-- ------------------------------------------------------------
module Holumbus.Crawler.URIs
where
-- import qualified Data.Set as S
import qualified Holumbus.Data.PrefixTree as S
-- ------------------------------------------------------------
-- | An URI is represented as a String
type URI =... | null | https://raw.githubusercontent.com/fortytools/holumbus/4b2f7b832feab2715a4d48be0b07dca018eaa8e8/crawl2/src/Holumbus/Crawler/URIs.hs | haskell | ------------------------------------------------------------
import qualified Data.Set as S
------------------------------------------------------------
| An URI is represented as a String
| A set of URIs implemeted as a prefix tree. This implementation
is space efficient, because of many equal prefixes i... | # OPTIONS #
module Holumbus.Crawler.URIs
where
import qualified Holumbus.Data.PrefixTree as S
type URI = String
type URIs = S.PrefixTree ()
emptyURIs :: URIs
emptyURIs = S.empty
singletonURIs :: URI -> URIs
singletonURIs = flip S.singleton ()
nullURIs :: URIs -> Bool
nullURIs = S.null
memberURIs ... |
4cd4c6d5a9ec0bdcbe2a8032bf5c3062e8d7a45d3b3952b6487d0883ec3d61c1 | NorfairKing/tickler | Types.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
{-# LANGUAGE OverloadedStrings #-}
module Tickler.Web.Server.OptParse.Types where
import Autodocodec
import Control.Monad.Logger
import Import
import Servant.Client.Core
import Tickler.Server.OptParse.Types ()
data Flags = Flags
{ flagConfigFile :: !(Maybe FilePa... | null | https://raw.githubusercontent.com/NorfairKing/tickler/49f10fd0c55d9702dd7bd0116557ddcde9cc3ce0/tickler-web-server/src/Tickler/Web/Server/OptParse/Types.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
module Tickler.Web.Server.OptParse.Types where
import Autodocodec
import Control.Monad.Logger
import Import
import Servant.Client.Core
import Tickler.Server.OptParse.Types ()
data Flags = Flags
{ flagConfigFile :: !(Maybe FilePath),
flagAPIBaseUrl :: !(Maybe ... |
3a161604e681770ad61feee1a0dabf7a5594533b83c18b56f7b94d2c7b9ff22e | jbrot/jstris-ai | Block.hs | # LANGUAGE DeriveGeneric , DeriveAnyClass #
module Tetris.Block where
data Block = I | J | L | O | S | T | Z
deriving (Eq, Show, Ord, Enum)
type Row = Int
type Col = Int
type Pos = (Row, Col)
type Rot = Int
data ActiveBlock = ActiveBlock { kind :: Block
, pos :: Pos
... | null | https://raw.githubusercontent.com/jbrot/jstris-ai/38e8120ed7b5d371ec381d6571df12976eb79bc1/src/Tetris/Block.hs | haskell | # LANGUAGE DeriveGeneric , DeriveAnyClass #
module Tetris.Block where
data Block = I | J | L | O | S | T | Z
deriving (Eq, Show, Ord, Enum)
type Row = Int
type Col = Int
type Pos = (Row, Col)
type Rot = Int
data ActiveBlock = ActiveBlock { kind :: Block
, pos :: Pos
... | |
60d662e3e43ddecf8a7cb945157b273eedbea6e34dd88a23aec5fafcf2c949c6 | BitGameEN/bitgamex | timer2_sup.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2011 - 2012 Juan Jose Comellas ,
%%% @doc High performance timer module
%%% @end
%%%
This source file is subject to the New BSD License . You should have received
%%% a copy of the New BSD license with this software... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/timer2/src/timer2_sup.erl | erlang | -------------------------------------------------------------------
@doc High performance timer module
@end
a copy of the New BSD license with this software. If not, it can be
retrieved from: -license.php
-------------------------------------------------------------------
API
Supervisor callbacks
--------------... | @author < >
( C ) 2011 - 2012 Juan Jose Comellas ,
This source file is subject to the New BSD License . You should have received
-module(timer2_sup).
-behaviour(supervisor).
-export([start_link/0, add_child/1, stop_workers/0]).
-export([init/1]).
-include("defaults.hrl").
-define(CHILD(Id, Type, M... |
0dc06916fb712a81f742d4b9e3e219585c540f525826f614be0f97127b0d5f45 | racket/drracket | wrap-tool-inputs.rkt | #lang racket/base
(provide wrap-tool-inputs)
(require racket/contract)
(require (for-syntax racket/base
racket/match
syntax/modread
compiler/cm-accomplice))
(define-syntax (wrap-tool-inputs stx)
(syntax-case stx ()
[(_ body tool-name replace?)
(... | null | https://raw.githubusercontent.com/racket/drracket/2d7c2cded99e630a69f05fb135d1bf7543096a23/drracket/drracket/private/wrap-tool-inputs.rkt | racket | need to replace the names in 'ctc' | #lang racket/base
(provide wrap-tool-inputs)
(require racket/contract)
(require (for-syntax racket/base
racket/match
syntax/modread
compiler/cm-accomplice))
(define-syntax (wrap-tool-inputs stx)
(syntax-case stx ()
[(_ body tool-name replace?)
(... |
7ac053deca6af774f1a36f63db52e4949b47b1e7e52ae5658dbeb340a7b9dc1f | jaked/ocamljs | minesweeper.ml | type config = {
nbcols : int ;
nbrows : int ;
nbmines : int }
let default_config = { nbcols=10; nbrows=10; nbmines=15 }
type cell = {
mutable mined : bool ;
mutable seen : bool ;
mutable flag : bool ;
mutable nbm : int
}
type board = cell array array
let iter_on_cell cf f =
for i=0 to cf.nbcols-1 ... | null | https://raw.githubusercontent.com/jaked/ocamljs/378080ff1c8033bb15ed2bd29bf1443e301d7af8/examples/dom/minesweeper/minesweeper.ml | ocaml | type config = {
nbcols : int ;
nbrows : int ;
nbmines : int }
let default_config = { nbcols=10; nbrows=10; nbmines=15 }
type cell = {
mutable mined : bool ;
mutable seen : bool ;
mutable flag : bool ;
mutable nbm : int
}
type board = cell array array
let iter_on_cell cf f =
for i=0 to cf.nbcols-1 ... | |
bcfd5b3051a75e912c999c5b71f8fdfa3805b170f07af4f7671441446d019e48 | YoshikuniJujo/test_haskell | Lib.hs | # , LambdaCase , OverloadedStrings #
# LANGUAGE ViewPatterns #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Lib where
import Control.Monad.Writer
import Data.Maybe
import Data.List.NonEmpty (NonEmpty(..))
import Codec.Wavefront
import Codec.Wavefront.IO
import qualified Data.List.NonEmpty as NE
import qualified... | null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/15aa08d0ffad3be8f9942cdaa48a164c60f47e89/tribial/try-wavefront-obj/src/Lib.hs | haskell | # , LambdaCase , OverloadedStrings #
# LANGUAGE ViewPatterns #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Lib where
import Control.Monad.Writer
import Data.Maybe
import Data.List.NonEmpty (NonEmpty(..))
import Codec.Wavefront
import Codec.Wavefront.IO
import qualified Data.List.NonEmpty as NE
import qualified... | |
bba4b8758dbe0efa1470a679d1f50a397643c9bfbb08ac847cab4d91ec4d1899 | kazu-yamamoto/domain-auth | Test.hs | # LANGUAGE OverloadedStrings , TemplateHaskell #
module Test where
import qualified Data.ByteString.Char8 as BS (pack,unpack)
import Data.IP
import Network.DNS as DNS hiding (answer)
import Network.DomainAuth
import Network.DomainAuth.DK.Types
import Network.DomainAuth.DKIM.Btag
import Network.DomainAuth.DKIM.Types
i... | null | https://raw.githubusercontent.com/kazu-yamamoto/domain-auth/d13145709a558145ac38e28e0b339c48b950b4e0/Test.hs | haskell | --------------------------------------------------------------
--------------------------------------------------------------
--------------------------------------------------------------
--------------------------------------------------------------
--------------------------------------------------------------
-----... | # LANGUAGE OverloadedStrings , TemplateHaskell #
module Test where
import qualified Data.ByteString.Char8 as BS (pack,unpack)
import Data.IP
import Network.DNS as DNS hiding (answer)
import Network.DomainAuth
import Network.DomainAuth.DK.Types
import Network.DomainAuth.DKIM.Btag
import Network.DomainAuth.DKIM.Types
i... |
894089526ae5493b4f8e266d43c4d9a9a00edbd57a62c638903c48ba28362cc9 | ublubu/shapes | AabbSpec.hs | module Physics.Broadphase.AabbSpec where
import Test.Hspec
import Test.QuickCheck
import Physics.Broadphase.Aabb
spec :: Spec
spec =
it "|unorderedPairs n| = n * n-1 / 2" $ property $
\(ItemCount n) -> length (unorderedPairs n) == (n * (n-1) `quot` 2)
newtype ItemCount = ItemCount Int deriving Show
instance ... | null | https://raw.githubusercontent.com/ublubu/shapes/fa5d959c17224a851d517826deeae097f1583392/shapes/test/Physics/Broadphase/AabbSpec.hs | haskell | module Physics.Broadphase.AabbSpec where
import Test.Hspec
import Test.QuickCheck
import Physics.Broadphase.Aabb
spec :: Spec
spec =
it "|unorderedPairs n| = n * n-1 / 2" $ property $
\(ItemCount n) -> length (unorderedPairs n) == (n * (n-1) `quot` 2)
newtype ItemCount = ItemCount Int deriving Show
instance ... | |
7e91e028db6d152169f01e5fcb2dc47e3d6ab04d8b0879eb44bd423ca4d22275 | Asana/kraken | kraken_client.erl | %% @doc TCP client for the memcached based kraken protocol for testing and
%% benchmarking.
-module(kraken_client).
%%%-----------------------------------------------------------------
%%% Exports
%%%-----------------------------------------------------------------
%% API
-export([connect/2, new_client/0, register/1... | null | https://raw.githubusercontent.com/Asana/kraken/51c7a2e334b6f40d7e3614b991dd3c877a07e6dc/src/kraken_client.erl | erlang | @doc TCP client for the memcached based kraken protocol for testing and
benchmarking.
-----------------------------------------------------------------
Exports
-----------------------------------------------------------------
API
-----------------------------------------------------------------
API
---------------... |
-module(kraken_client).
-export([connect/2, new_client/0, register/1, subscribe/2,
retro_subscribe/3, unsubscribe/2, disconnect/1, publish/2,
assert_receive/2, receive_messages/1, quit/1]).
connect(Host, Port) ->
gen_tcp:connect(Host, Port, [binary,
{packet, line}... |
e8fcd7b723c898dd1a2979103563e5616f1c6c1041b6f26cdb54f4b03229d1c6 | ChrisPenner/comonads-by-example | Conway.hs | # LANGUAGE DeriveFunctor #
# LANGUAGE DeriveFoldable #
{-# LANGUAGE DeriveTraversable #-}
module Comonads.Store.Conway where
import Control.Comonad
import Comonads.Store
import qualified Data.Set as S
import Data.Monoid (Sum(..), Ap(..))
import Data.Foldable (toList)
import Data.List (intersperse)
import Control.Appl... | null | https://raw.githubusercontent.com/ChrisPenner/comonads-by-example/1d7626f759e59ac8019322612ed6d7ff00da75c9/src/Comonads/Store/Conway.hs | haskell | # LANGUAGE DeriveTraversable #
| We represent a coordinate as a product of sums so we can use 'mappend' for easy shifting
| A type containing a slot for each neighbour
| Given a coordinate, compute all the neighbours of that position.
OR
OTHERWISE the cell is dead in the next iteration
| The starting state of the... | # LANGUAGE DeriveFunctor #
# LANGUAGE DeriveFoldable #
module Comonads.Store.Conway where
import Control.Comonad
import Comonads.Store
import qualified Data.Set as S
import Data.Monoid (Sum(..), Ap(..))
import Data.Foldable (toList)
import Data.List (intersperse)
import Control.Applicative (ZipList(..))
type Coord =... |
c9b4d2837bcc31344d4561c6dfca053ce320b085e3240c000b1b3520707be4c9 | borodust/claw | typedef.lisp | (cl:in-package :claw.cffi.c)
(defun %generate-typedef-binding (entity)
(let* ((id (entity->cffi-type entity))
(aliased-type (entity->cffi-type (check-entity-known
(claw.spec:foreign-enveloped-entity entity)))))
(export-symbol id)
`((cffi:defctype ,id ,alia... | null | https://raw.githubusercontent.com/borodust/claw/a92d4cc868820713cf221c4160cf76aa4ff7e385/src/gen/cffi/c/generator/typedef.lisp | lisp | (cl:in-package :claw.cffi.c)
(defun %generate-typedef-binding (entity)
(let* ((id (entity->cffi-type entity))
(aliased-type (entity->cffi-type (check-entity-known
(claw.spec:foreign-enveloped-entity entity)))))
(export-symbol id)
`((cffi:defctype ,id ,alia... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.