_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 |
|---|---|---|---|---|---|---|---|---|
c84da8309679552ca8a8dc088be0fa59b01854e042f6909f01268a2da19007ae | ecraven/r7rs-swank | chicken-swank.scm | (import (chicken file)
(chicken format)
(chicken pretty-print)
(chicken random)
(chicken syntax)
(chicken tcp)
(chicken random)
(srfi-1)
(srfi-13)
(srfi-69))
(begin
(load "specific/chicken.scm")
(load "common/base.scm")
(load "common/handlers... | null | https://raw.githubusercontent.com/ecraven/r7rs-swank/13c23b21c18a1640d14c655e817be32a548cae3b/chicken-swank.scm | scheme | (import (chicken file)
(chicken format)
(chicken pretty-print)
(chicken random)
(chicken syntax)
(chicken tcp)
(chicken random)
(srfi-1)
(srfi-13)
(srfi-69))
(begin
(load "specific/chicken.scm")
(load "common/base.scm")
(load "common/handlers... | |
c36b67b8a543fb87d7d1d64b84d68b75ddbdaf4e81ab5ce407195b70a1c2b035 | martinslota/protocell | google_protobuf_compiler_plugin_pc.ml | [@@@ocaml.warning "-39"]
let ( >>= ) = Runtime.Result.( >>= )
let ( >>| ) = Runtime.Result.( >>| )
module Field' = Runtime.Field_value
module Bin' = Runtime.Binary_format
module Text' = Runtime.Text_format
module rec Version : sig
type t = {
major : int option;
minor : int option;
patch : int option;
... | null | https://raw.githubusercontent.com/martinslota/protocell/62545c7fb63ff76c95449ba015e40e0c3e0d94a5/src/protoc_interface/google_protobuf_compiler_plugin_pc.ml | ocaml | [@@@ocaml.warning "-39"]
let ( >>= ) = Runtime.Result.( >>= )
let ( >>| ) = Runtime.Result.( >>| )
module Field' = Runtime.Field_value
module Bin' = Runtime.Binary_format
module Text' = Runtime.Text_format
module rec Version : sig
type t = {
major : int option;
minor : int option;
patch : int option;
... | |
82f8e678658052d3571f31764867d94e7c434fec90d59b7eee1e86fcec09801d | KingoftheHomeless/in-other-words | Debug.hs | -- | Utilities for debugging
module Control.Effect.Debug where
import Control.Effect.Carrier
import Data.Kind (Type)
import GHC.TypeLits
Type family needed to delay the TypeError until when ' debugEffects '
-- is used.
type family DebugEffects (m :: Type -> Type) :: k where
DebugEffects m = TypeError ( 'Text ... | null | https://raw.githubusercontent.com/KingoftheHomeless/in-other-words/b3574738bf8786a641c281c16202926ba674f7e2/src/Control/Effect/Debug.hs | haskell | | Utilities for debugging
is used.
| A placeholder action of @m@ that causes a compile-time error
that tells you the derived and primitive effects of @m@.
Doesn't work when @m@ is polymorphic. | module Control.Effect.Debug where
import Control.Effect.Carrier
import Data.Kind (Type)
import GHC.TypeLits
Type family needed to delay the TypeError until when ' debugEffects '
type family DebugEffects (m :: Type -> Type) :: k where
DebugEffects m = TypeError ( 'Text "Control.Effect.Debug.debugEffects"
... |
3a99a99caa1edc02a69a9d977553ddcae6c821458765f46a435f6d6daa53c166 | marcelosousa/llvmvf | Module.hs | -------------------------------------------------------------------------------
-- Module : Analysis.Type.Memory.Module
Copyright : ( c ) 2013
-- A Type System for Memory Analysis of LLVM IR Modules
-- Type Inference
-------------------------------------------------------------------------------
module Analy... | null | https://raw.githubusercontent.com/marcelosousa/llvmvf/c314e43aa8bc8bb7fd9c83cebfbdcabee4ecfe1b/src/Analysis/Type/Memory/Module.hs | haskell | -----------------------------------------------------------------------------
Module : Analysis.Type.Memory.Module
A Type System for Memory Analysis of LLVM IR Modules
Type Inference
-----------------------------------------------------------------------------
Old Module TyAnn Inference | Copyright : ( c ) 2013
module Analysis.Type.Memory.Module (tyanModule) where
import qualified Data.Map as M
import qualified Data.Set as S
import Language.LLVMIR
import Analysis.Type.Util
import Analysis.Type.Memory.Context
import Analysis.Type.Memory.Global (tyanGlobal)
import Analysis.Type.Memory.Function... |
1915a7c98d703e0db26de264f5c6a4f8793bf937f30db86db048425d7d15c321 | typelead/eta | tc063.hs | module ShouldSucceed where
data X a = Tag a
class Reps r where
f :: r -> r -> r
instance Reps (X q) where
-- f (Tag x) (Tag y) = Tag y
f x y = y
instance Reps Bool where
f True True = True
f x y = False
g x = f x x
| null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/compile/tc063.hs | haskell | f (Tag x) (Tag y) = Tag y | module ShouldSucceed where
data X a = Tag a
class Reps r where
f :: r -> r -> r
instance Reps (X q) where
f x y = y
instance Reps Bool where
f True True = True
f x y = False
g x = f x x
|
ae84c9fc1ec191492203f5807077cd57a45e468dc90cd47cf0e63e00f4239d77 | codedownio/sandwich | Printing.hs |
-- | Utility functions for printing
module Test.Sandwich.Formatters.Print.Printing where
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Reader
import qualified Data.List as L
import System.Console.ANSI
import System.IO
import Test.Sandwich.Formatters.Print.Types
import Test.Sandwich.Util
-... | null | https://raw.githubusercontent.com/codedownio/sandwich/9c8f56b5aee94ba65c70b3e52bde8959010aecc1/sandwich/src/Test/Sandwich/Formatters/Print/Printing.hs | haskell | | Utility functions for printing
* Printing functions for indented, colored, and with newline
Tried solarizedRed here but it was too orange |
module Test.Sandwich.Formatters.Print.Printing where
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Reader
import qualified Data.List as L
import System.Console.ANSI
import System.IO
import Test.Sandwich.Formatters.Print.Types
import Test.Sandwich.Util
pi msg = printIndentedWithColor Noth... |
3354627878d021ee8180d2f7602ef4e7d6445bcd64b9a962d02a30b59f86c06b | dstarcev/stepic-haskell | Task7.hs | module Module2.Task7 where
class KnownToGork a where
stomp :: a -> a
doesEnrageGork :: a -> Bool
class KnownToMork a where
stab :: a -> a
doesEnrageMork :: a -> Bool
class (KnownToGork a, KnownToMork a) => KnownToGorkAndMork a where
stompOrStab :: a -> a
stompOrStab x
| doesEnrageMork x && doesEnrage... | null | https://raw.githubusercontent.com/dstarcev/stepic-haskell/6a8cf4b3cc17333ac4175e825db57dbe151ebae0/src/Module2/Task7.hs | haskell | module Module2.Task7 where
class KnownToGork a where
stomp :: a -> a
doesEnrageGork :: a -> Bool
class KnownToMork a where
stab :: a -> a
doesEnrageMork :: a -> Bool
class (KnownToGork a, KnownToMork a) => KnownToGorkAndMork a where
stompOrStab :: a -> a
stompOrStab x
| doesEnrageMork x && doesEnrage... | |
8954f4ac85d98794c1f2fd89003f4b97aef73d97954597ce30c02a900e0920a2 | nikomatsakis/a-mir-formality | move-set-map.rkt | #lang racket
(require redex/reduction-semantics
"../grammar.rkt"
"move-set.rkt"
)
(provide add-move-set-to-map
union-move-set-maps
)
(define-metafunction formality-body
Updates the move - set - map so that the paths in ` MoveSet ` are considered moved on entry to
;; `Ba... | null | https://raw.githubusercontent.com/nikomatsakis/a-mir-formality/71be4d5c4bd5e91d326277eaedd19a7abe3ac76a/racket-src/body/borrow-check/move-set-map.rkt | racket | `BasicBlockIds` (in addition to whatever paths were already considered moved).
`BasicBlockIds` (in addition to whatever paths were already considered moved).
Helper for the above that permits only a single basic block | #lang racket
(require redex/reduction-semantics
"../grammar.rkt"
"move-set.rkt"
)
(provide add-move-set-to-map
union-move-set-maps
)
(define-metafunction formality-body
Updates the move - set - map so that the paths in ` MoveSet ` are considered moved on entry to
union-... |
9ed122cbbd1d152863439b68e5d057d45cfe40008d97f418306f57b74d128aea | michiakig/LispInSmallPieces | variante1.scm | $ I d : variante1.scm , v 1.5 2006/11/25 17:44:13
;;;(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
;;; This file is part of the files that accompany the book:
LISP Implantation Semantique Programmation ( InterEditions , France )
By Christian Queinnec < >
;;; Newest version may... | null | https://raw.githubusercontent.com/michiakig/LispInSmallPieces/0a2762d539a5f4c7488fffe95722790ac475c2ea/meroonet/variante1.scm | scheme | (((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
This file is part of the files that accompany the book:
Newest version may be retrieved from:
Check the README file before using this file.
(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
VARIANT 1: a simple-minded ... | $ I d : variante1.scm , v 1.5 2006/11/25 17:44:13
LISP Implantation Semantique Programmation ( InterEditions , France )
By Christian Queinnec < >
( IP 128.93.2.54 ) ftp.inria.fr : INRIA / Projects / icsla / Books / LiSP*.tar.gz
This file is part of the Meroonet package .
at that same time . Th... |
efc1a90e4e69a71ff98e11864f206e9b25c9d5c4a6a39ff522c53e948ea21a4a | igarnier/clustering | k_means.ml | open Batteries
(* We require elements to have the structure of a
metric space and to support the computing of geometric means. *)
module type Element =
sig
type t
This should be a proper distance function ( symmetric , zero on the diagonal ,
verifying the triangular inequality ) .
verifying the tr... | null | https://raw.githubusercontent.com/igarnier/clustering/4c20f9a253abeeeb6a0f05430d5d72957942ef1e/lib/k_means.ml | ocaml | We require elements to have the structure of a
metric space and to support the computing of geometric means.
Selects k elements at random (without replacement)
Select a random partition
[compute_classes centroids elements] computes for each centroid
the set of elements which are closest to it, i.e. it co... | open Batteries
module type Element =
sig
type t
This should be a proper distance function ( symmetric , zero on the diagonal ,
verifying the triangular inequality ) .
verifying the triangular inequality). *)
val dist : t -> t -> float
val mean : t array -> t
end
type init =
K - means++
typ... |
38b85f6240c5adf13c969fec039db1e2bde22f1ff9a240908761d8f86ce8ab73 | YoshikuniJujo/test_haskell | Overlappable.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Overlappable where
class IsChar c where isChar :: c -> String
instance IsChar Char where isChar _ = "It's Char!"
instance {-# OVERLAPPABLE #-} IsChar a where isChar _ = "It isn't Char."
class SayIsChar ... | null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/8c1b0b242b8be1f3bf52f84f0ba13a19c2e6f532/tribial/try-tribials/src/Overlappable.hs | haskell | # OVERLAPPABLE # | # LANGUAGE FlexibleInstances #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Overlappable where
class IsChar c where isChar :: c -> String
instance IsChar Char where isChar _ = "It's Char!"
class SayIsChar c where sayIsChar :: c -> IO ()
instance IsChar c => SayIsChar c where s... |
8f8815798a42e65b9867cb3dbc496e0f3b7f1045e679c3d689000c13acaa71b7 | huangjs/cl | dlasrt.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 1.215 2009/04/07 22:05:21 rtoy Exp $ "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.200 2009/01/19 02:38:17 rtoy Exp $ "
" f2cl6.l ,... | null | https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/maxima/share/lapack/lapack/dlasrt.lisp | lisp | Compiled by f2cl version:
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 1.215 2009/04/07 22:05:21 rtoy Exp $ "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.200 2009/01/19 02:38:17 rtoy Exp $ "
" f2cl6.l , v 1.48 2008/08/24 00:56:27 rt... |
4e5671ac6c0a7fc5382d6b101bc9554fe6120d77e84cbf92dda773d82fccce4d | DavidAlphaFox/RabbitMQ | rabbit_test_util.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/DavidAlphaFox/RabbitMQ/0a64e6f0464a9a4ce85c6baa52fb1c584689f49a/plugins-src/rabbitmq-test/src/rabbit_test_util.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
----------------... | The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2007 - 2014 GoPivotal , Inc. All rights reserved .
-module(... |
89374283dc7ca04cb14f152de86848ad0551da4d083ea58bd1bfc939c9e4eef4 | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | TerminalReaderReaderResourceLineItem.hs | {-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
-- | Contains the types generated from the schema TerminalReaderReaderResourceLineItem
module StripeAPI.Types.TerminalReaderR... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/TerminalReaderReaderResourceLineItem.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Contains the types generated from the schema TerminalReaderReaderResourceLineItem
| Defines the object schema located at @components.schemas.terminal_reader_reader_resource_line_item@ in the specification.
Represents a line item to be displayed on the reader
... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
module StripeAPI.Types.TerminalReaderReaderResourceLineItem where
import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Intern... |
e21d4bf0b656c809e1ff8a0bdca291ae822847d4555e6c488bd5ba9a6d078ce0 | avsm/platform | examples.ml | (* Examples from the documentation, this code is in public domain. *)
(* Read lines *)
let lines ?encoding (src : [`Channel of in_channel | `String of string]) =
let rec loop d buf acc = match Uutf.decode d with
| `Uchar u ->
begin match Uchar.to_int u with
| 0x000A ->
let line = Buffer.cont... | null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/uutf.1.0.2%2Bdune/test/examples.ml | ocaml | Examples from the documentation, this code is in public domain.
Read lines
Recode |
let lines ?encoding (src : [`Channel of in_channel | `String of string]) =
let rec loop d buf acc = match Uutf.decode d with
| `Uchar u ->
begin match Uchar.to_int u with
| 0x000A ->
let line = Buffer.contents buf in
Buffer.clear buf; loop d buf (line :: acc)
| _ ->
... |
4e45b057b1e82afaebf2e632b8a0af2c51cc26c54a22d2b33ec195204b09edf9 | mario-goulart/salmonella | salmonella-version.scm | (define salmonella-version "3.0.1")
| null | https://raw.githubusercontent.com/mario-goulart/salmonella/3b207e3b33490e5a5f81ccaa3c2c7f7ffcbe8125/salmonella-version.scm | scheme | (define salmonella-version "3.0.1")
| |
06ed460d1a8c8a5a833f6cf758528872e614a4bf0eebe5fd6611b001ea2ccc29 | seckcoder/course-compiler | r2_9.rkt | (if (eq? 1 1) 42 777)
| null | https://raw.githubusercontent.com/seckcoder/course-compiler/4363e5b3e15eaa7553902c3850b6452de80b2ef6/tests/student-tests/r2_9.rkt | racket | (if (eq? 1 1) 42 777)
| |
27635d22f41008a352af8c0376dd7a09843941e91422fb419001040fe49af10d | mahsu/MariOCaml | actors.ml | type dir_1d = | Left | Right
type dir_2d = | North | South | East | West
type xy = {
mutable x: float;
mutable y: float;
}
type controls =
| CLeft
| CRight
| CUp
| CDown
type pl_typ =
| BigM
| SmallM
type item_typ =
| Mushroom
| FireFlower
| Star
| Coin
type enemy_typ =
| Goomba
| GKoop... | null | https://raw.githubusercontent.com/mahsu/MariOCaml/d2359260895b77390648ca5ad126a897e639e7e4/actors.ml | ocaml | type dir_1d = | Left | Right
type dir_2d = | North | South | East | West
type xy = {
mutable x: float;
mutable y: float;
}
type controls =
| CLeft
| CRight
| CUp
| CDown
type pl_typ =
| BigM
| SmallM
type item_typ =
| Mushroom
| FireFlower
| Star
| Coin
type enemy_typ =
| Goomba
| GKoop... | |
06a9850921fbc3b60bb76057a0a2b4f18985bf9f0e56d4dee1d7998a35138cdd | swaywm/cl-wlroots | compositor-grovel.lisp | (in-package #:wlr/types/compositor)
(pkg-config-cflags "wlroots")
(cc-flags "-DWLR_USE_UNSTABLE")
(include "wlr/types/wlr_compositor.h")
(cstruct subcompositor "struct wlr_subcompositor"
(:global "global" :type :pointer)
(:resources "resources" :type (:struct wl_list))
(:subsurface-resources "subsurface_resourc... | null | https://raw.githubusercontent.com/swaywm/cl-wlroots/f8a33979e45086ecd5c7deefd5ee067b941e0998/wlr/types/compositor-grovel.lisp | lisp | (in-package #:wlr/types/compositor)
(pkg-config-cflags "wlroots")
(cc-flags "-DWLR_USE_UNSTABLE")
(include "wlr/types/wlr_compositor.h")
(cstruct subcompositor "struct wlr_subcompositor"
(:global "global" :type :pointer)
(:resources "resources" :type (:struct wl_list))
(:subsurface-resources "subsurface_resourc... | |
cefdafe8f84093ba4aea88f60301e1d7fe15e02edad3dc729f79b083311929e0 | rudymatela/extrapolate | Expr.hs | for GHC < = 7.8
-- |
-- Module : Test.Extrapolate.Expr
Copyright : ( c ) 2017 - 2019
License : 3 - Clause BSD ( see the file LICENSE )
Maintainer : < >
--
-- This module is part of Extrapolate,
-- a library for generalization of counter-examples.
--
-- This module re-exports functionality ... | null | https://raw.githubusercontent.com/rudymatela/extrapolate/0b3ca28eed0d04358b2fb033664476f8b29821a6/src/Test/Extrapolate/Expr.hs | haskell | |
Module : Test.Extrapolate.Expr
This module is part of Extrapolate,
a library for generalization of counter-examples.
This module re-exports functionality from
along with some extra utilities.
* misc re-exports
|
Like 'canonicalize' but uses holes for unrepeated variables.
|
| /O(n)/.
| for GHC < = 7.8
Copyright : ( c ) 2017 - 2019
License : 3 - Clause BSD ( see the file LICENSE )
Maintainer : < >
" Data . Express " and " Test . Speculate . "
module Test.Extrapolate.Expr
( module Data.Express
, module Test.Speculate.Expr
, canonicalizeUsingHoles
, canonicalizeUsing... |
93f953260de718e60b4dea20801ab5e90df70395362e9cd8b626317977d4b55e | tnelson/FlowLog | Flowlog_Builtins.ml | open Flowlog_Types
open Flowlog_Helpers
open NetCore_Types
open Printf
open ExtList.List
Some predicates are built in , e.g. " add " . So for instance if a formula is :
( " " , " add " , [ TConst("1 " ) , TVar("x " ) , TVar("pt " ) ] ) the add is interpreted by this module , not
treated as a state predica... | null | https://raw.githubusercontent.com/tnelson/FlowLog/8be5051a4b3fa05c6299cdfa70f6a3def3893cf1/interpreter/Flowlog_Builtins.ml | ocaml | ID must be lowercase
FAtom("", "add", ...) -->
*******************************************************************************
*******************************************************************************
hasLongerPrefixMatch(p.locSw, pre, mask)
HARD CODED to use a SPECIFIC table name and arity!
Note the... | open Flowlog_Types
open Flowlog_Helpers
open NetCore_Types
open Printf
open ExtList.List
Some predicates are built in , e.g. " add " . So for instance if a formula is :
( " " , " add " , [ TConst("1 " ) , TVar("x " ) , TVar("pt " ) ] ) the add is interpreted by this module , not
treated as a state predica... |
cb9c8b1b64b9240b248b6cd9cb16f90d79b21979dfcabf107ca1198487885e7a | codereport/SICP-2020 | lesley_lai_solutions_ii.rkt | #lang racket
(require rackunit
threading)
;; Code for stream pattern matching
;; From -matching-with-streams-in-racket
(require syntax/parse/define (prefix-in * racket/stream))
(define (stream-empty? v) (and (stream? v) (*stream-empty? v)))
(define (stream-cons? v) (and (stream? v) (not (*stream-empty? v))))... | null | https://raw.githubusercontent.com/codereport/SICP-2020/2d1e60048db89678830d93fcc558a846b7f57b76/Chapter%203.5%20Solutions/lesley_lai_solutions_ii.rkt | racket | Code for stream pattern matching
From -matching-with-streams-in-racket
A stream-map that accept variadic numbers of argument
dy/dt = y
Solution: y = c_0 e^t
Explicit Euler diverges really rapidly on exponentials :-(
rand-update implementation steal from
-update.scm | #lang racket
(require rackunit
threading)
(require syntax/parse/define (prefix-in * racket/stream))
(define (stream-empty? v) (and (stream? v) (*stream-empty? v)))
(define (stream-cons? v) (and (stream? v) (not (*stream-empty? v))))
(define-match-expander stream-cons
(syntax-parser
[(_ fst rst) #'(? s... |
55d40964db2e766083dec623b375daecc91d1eb113667b35b4a3ca78a59884a6 | alavrik/piqi | piq_gen.ml |
Copyright 2009 , 2010 , 2011 , 2012 , 2013 , 2014 , 2015 , 2017
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or... | null | https://raw.githubusercontent.com/alavrik/piqi/bcea4d44997966198dc295df0609591fa787b1d2/piqilib/piq_gen.ml | ocaml | split (utf8) string into individual lines treating '\n' as a separator
NOTE: list is not empty
XXX: printing large unsigned uint values in hex
Ensure that the float is not printed as an int.
This is not required by JSON, but useful in order to guarantee
reversibility.
Both write_float_fast and write_fl... |
Copyright 2009 , 2010 , 2011 , 2012 , 2013 , 2014 , 2015 , 2017
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or... |
8c6596a0e450cb4f9a34be58507437b27d8c5c8ba678111f09df0674856b0830 | static-analysis-engineering/codehawk | jCHBytecodeData.ml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Copy... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/98ced4d5e6d7989575092df232759afc2cb851f6/CodeHawk/CHJ/jchpre/jCHBytecodeData.ml | ocaml | chutil
jchlib
jchpre | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Copy... |
adb2b9605469769a243066be0f68b7d2da32540208deeca444e42656abcc3ebb | lowasser/TrieMap | Option.hs | {-# LANGUAGE Rank2Types #-}
module Control.Monad.Option (Option, option, runOption, none, maybeToOption, liftOption, isSome) where
import Control.Monad
import Control.Applicative
newtype Option a = Option {execOption :: forall r . r -> (a -> r) -> r}
option :: (forall r . r -> (a -> r) -> r) -> Option a
option = Opt... | null | https://raw.githubusercontent.com/lowasser/TrieMap/1ab52b8d83469974a629f2aa577a85de3f9e867a/Control/Monad/Option.hs | haskell | # LANGUAGE Rank2Types # | module Control.Monad.Option (Option, option, runOption, none, maybeToOption, liftOption, isSome) where
import Control.Monad
import Control.Applicative
newtype Option a = Option {execOption :: forall r . r -> (a -> r) -> r}
option :: (forall r . r -> (a -> r) -> r) -> Option a
option = Option
runOption :: Option a -... |
1adadbd7ca22977931031ba8f06b5fc9fc12a8c572da6599922d2de5162556a3 | eggzilla/BlastHTTP | BlastTabularHTTPTest.hs | -- | BlastHTTP test script
--ghc - arg=.cabal - sandbox / x86_64 - linux - ghc-8.0.1 - packages.conf.d/ BlastTabularHTTPTest.hs aeromonas.fa
module Main where
import System.Environment (getArgs)
import System.Process
import Text.ParserCombinators.Parsec
import System.IO
import System.Environment
import Data.... | null | https://raw.githubusercontent.com/eggzilla/BlastHTTP/b4d7b7ab87c78ce21d00806a48a14c82d9525a78/BlastTabularHTTPTest.hs | haskell | | BlastHTTP test script
ghc - arg=.cabal - sandbox / x86_64 - linux - ghc-8.0.1 - packages.conf.d/ BlastTabularHTTPTest.hs aeromonas.fa |
module Main where
import System.Environment (getArgs)
import System.Process
import Text.ParserCombinators.Parsec
import System.IO
import System.Environment
import Data.List
import System.Directory
import System.Process
import Control.Monad
import Data.Either.Unwrap
import Bio.BlastHTTP
import Biobase.Fasta.S... |
77a67a615effbce89d778dc271c19b41800abcd068ada97555d0b619d277fddc | uditkarode/montype | Utils.hs | {-# LANGUAGE OverloadedStrings #-}
module Utils where
import Data.Text as T (Text, pack, replace, unpack)
import Data.Void (Void)
import System.Console.Pretty
( Color (Green, Red, Yellow),
Pretty (color, style),
Style (Bold),
)
import System.IO (hPutStr, hPutStrLn, stderr, stdout)
import Text.Megaparsec a... | null | https://raw.githubusercontent.com/uditkarode/montype/2ec01ee710d940ce4196cdd54fdf1ead53f1810a/src/Utils.hs | haskell | # LANGUAGE OverloadedStrings # |
module Utils where
import Data.Text as T (Text, pack, replace, unpack)
import Data.Void (Void)
import System.Console.Pretty
( Color (Green, Red, Yellow),
Pretty (color, style),
Style (Bold),
)
import System.IO (hPutStr, hPutStrLn, stderr, stdout)
import Text.Megaparsec as P (Parsec)
type Parser = Parsec ... |
a943c2e79c2faeac4a8674a5d6589edc097818c0a843386be77b2f1d7ede5e97 | freizl/dive-into-haskell | Exe1.hs | -- |
module Exe1 where
import Control.Monad.Trans.State
import Control.Monad.Trans.Reader
import Data.Functor.Identity
import Test.Hspec
rDec :: Num a => Reader a a
rDec = reader (+ (-1))
rShow :: Show a => ReaderT a Identity String
rShow = ReaderT (Identity . show)
rPrintAndInc :: (Num a, Show a) => ReaderT a IO a... | null | https://raw.githubusercontent.com/freizl/dive-into-haskell/b18a6bfe212db6c3a5d707b4a640170b8bcf9330/readings/haskell-book/26/Exe1.hs | haskell | | | module Exe1 where
import Control.Monad.Trans.State
import Control.Monad.Trans.Reader
import Data.Functor.Identity
import Test.Hspec
rDec :: Num a => Reader a a
rDec = reader (+ (-1))
rShow :: Show a => ReaderT a Identity String
rShow = ReaderT (Identity . show)
rPrintAndInc :: (Num a, Show a) => ReaderT a IO a
rPri... |
2a869a984333ad758d9cd8d4adb9d37a902f59ea953ef100c18a628bc8315a9a | vito/hummus | Prelude.hs | {-# LANGUAGE RankNTypes #-}
module Hummus.Prelude where
import Control.Monad
import Control.Monad.CC
import Control.Monad.CC.Dynvar
import Control.Monad.Trans
import Data.Attoparsec
import Data.IORef
import Data.Time
import qualified Data.ByteString as BS
import Hummus.Types
import Hummus.Parser
import Hummus.Runtime... | null | https://raw.githubusercontent.com/vito/hummus/308f9f7aaf57b799c81ab902880f024ee6313424/src/Hummus/Prelude.hs | haskell | # LANGUAGE RankNTypes # | module Hummus.Prelude where
import Control.Monad
import Control.Monad.CC
import Control.Monad.CC.Dynvar
import Control.Monad.Trans
import Data.Attoparsec
import Data.IORef
import Data.Time
import qualified Data.ByteString as BS
import Hummus.Types
import Hummus.Parser
import Hummus.Runtime
import Paths_hummus
new ... |
1bc2273309677018187d60e76c7235644c0b1feb67bbabf293a35bd16894452b | nodename/edge-algebra | delaunay_test.clj | (ns delaunay.delaunay-test
(:require [clojure.test :refer :all]
[clojure.core.async :refer [<! go go-loop chan]]
[delaunay.div-conq :refer [pt org dest delaunay]]
[delaunay.utils.reporting :refer [with-reporting]]))
#_
(deftest two-triangles-test
(let [a (pt 0 0)
b (pt ... | null | https://raw.githubusercontent.com/nodename/edge-algebra/26ad60f4b7a1f4b6979456437433f797054168d8/test/delaunay/delaunay_test.clj | clojure | (ns delaunay.delaunay-test
(:require [clojure.test :refer :all]
[clojure.core.async :refer [<! go go-loop chan]]
[delaunay.div-conq :refer [pt org dest delaunay]]
[delaunay.utils.reporting :refer [with-reporting]]))
#_
(deftest two-triangles-test
(let [a (pt 0 0)
b (pt ... | |
62317affd6ad06316cc4666fbcc1d0dbabd421ea62248595df76beac93479c5a | nominolo/scion | GetImports.hs | module Main where
import GHC
import Scion
import MonadUtils ( liftIO )
import qualified StringBuffer as SB
import Outputable
import HscTypes
import Data.Maybe
import Control.Monad
import System.Environment
main = runScion $ do
[working_dir, dist_dir] <- io $ getArgs
setWorkingDir working_dir
liftIO $ print wor... | null | https://raw.githubusercontent.com/nominolo/scion/99b4589175665687181a932cd836850205625f71/examples/GetImports.hs | haskell | load LoadAllTargets
liftIO $ print ("total", cs) | module Main where
import GHC
import Scion
import MonadUtils ( liftIO )
import qualified StringBuffer as SB
import Outputable
import HscTypes
import Data.Maybe
import Control.Monad
import System.Environment
main = runScion $ do
[working_dir, dist_dir] <- io $ getArgs
setWorkingDir working_dir
liftIO $ print wor... |
2971ed226e2a8a0f269fe3617f90c9a1de72d3e5c9eacd04d632514713585831 | lambdaisland/ansi | user.clj | (ns user)
(defn add-dependency [dep-vec]
(require 'cemerick.pomegranate)
((resolve 'cemerick.pomegranate/add-dependencies)
:coordinates [dep-vec]
:repositories (merge @(resolve 'cemerick.pomegranate.aether/maven-central)
{"clojars" ""})))
| null | https://raw.githubusercontent.com/lambdaisland/ansi/76a239f820e8f85790cf5b578ad0f08c8e24cf75/dev/user.clj | clojure | (ns user)
(defn add-dependency [dep-vec]
(require 'cemerick.pomegranate)
((resolve 'cemerick.pomegranate/add-dependencies)
:coordinates [dep-vec]
:repositories (merge @(resolve 'cemerick.pomegranate.aether/maven-central)
{"clojars" ""})))
| |
c6f0ce017ebb82c61e0008be346bb64a35e2392c6b55be6462aeeedff1660d85 | uim/uim | skk-key-custom.scm | skk-key-custom.scm : Customization variables for SKK key bindings
;;;
Copyright ( c ) 2003 - 2013 uim Project
;;;
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
1 . Redistribut... | null | https://raw.githubusercontent.com/uim/uim/d1ac9d9315ff8c57c713b502544fef9b3a83b3e5/scm/skk-key-custom.scm | scheme |
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer in the
documen... | skk-key-custom.scm : Customization variables for SKK key bindings
Copyright ( c ) 2003 - 2013 uim Project
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
3 . Neither the name of authors nor the names of its contributors
... |
1e36e2d55decc957248ce2fdf0b666a227e535f944a696ba580d7f72304fcf21 | kupl/LearnML | patch.ml | type aexp =
| Const of int
| Var of string
| Power of (string * int)
| Times of aexp list
| Sum of aexp list
let rec diff ((exp : aexp), (x : string)) : aexp =
match exp with
| Const n -> Const 0
| Var v -> if v = x then Const 1 else Const 0
| Power (v, n) ->
if v = x then Times [ Const n; Powe... | null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/diff/sub163/patch.ml | ocaml | type aexp =
| Const of int
| Var of string
| Power of (string * int)
| Times of aexp list
| Sum of aexp list
let rec diff ((exp : aexp), (x : string)) : aexp =
match exp with
| Const n -> Const 0
| Var v -> if v = x then Const 1 else Const 0
| Power (v, n) ->
if v = x then Times [ Const n; Powe... | |
3f254ccca30d213cdd3f53ee8c44605ebcce4edda06840a3bf6f3600f2ef0a62 | sbcl/sbcl | mop-32.impure.lisp | ;;;; Handling errors in UPDATE-INSTANCE-FOR-REDEFINED-CLASS
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
While most of SBCL is derived from the CMU CL system , the test
;;;; files (like this one) were written from scratch after the fork
from CMU CL .
;;;;
;;;; Th... | null | https://raw.githubusercontent.com/sbcl/sbcl/7daaaf9b831d51929c296c84fc8ffed051bca973/tests/mop-32.impure.lisp | lisp | Handling errors in UPDATE-INSTANCE-FOR-REDEFINED-CLASS
more information.
files (like this one) were written from scratch after the fork
This software is in the public domain and is provided with
absolutely no warranty. See the COPYING and CREDITS files for
more information.
This U-I-F-R-C is meant to always si... |
This software is part of the SBCL system . See the README file for
While most of SBCL is derived from the CMU CL system , the test
from CMU CL .
(defclass foo-class (standard-class) ())
(defmethod sb-mop:validate-superclass ((c foo-class) (s standard-class)) t)
(defclass foo-object (standard-object) ())
(def... |
775835d5a2ad18ab4338976190bccd80b3655c37137f4696c24986a475333126 | luminus-framework/examples | layout.clj | (ns guestbook.layout
(:require
[clojure.java.io]
[selmer.parser :as parser]
[selmer.filters :as filters]
[markdown.core :refer [md-to-html-string]]
[ring.util.http-response :refer [content-type ok]]
[ring.util.anti-forgery :refer [anti-forgery-field]]
[ring.middleware.anti-forgery :refer [... | null | https://raw.githubusercontent.com/luminus-framework/examples/cbeee2fef8f457a6a6bac2cae0b640370ae2499b/guestbook/src/clj/guestbook/layout.clj | clojure | (ns guestbook.layout
(:require
[clojure.java.io]
[selmer.parser :as parser]
[selmer.filters :as filters]
[markdown.core :refer [md-to-html-string]]
[ring.util.http-response :refer [content-type ok]]
[ring.util.anti-forgery :refer [anti-forgery-field]]
[ring.middleware.anti-forgery :refer [... | |
968b29302f59bc24e80abb225f3b4130ccbe5f5dc55bd447a300b8d3908277ec | craigl64/clim-ccl | color-editor.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Package : CLIM - DEMO ; Base : 10 ; Lowercase : Yes -*-
;; See the file LICENSE for the full license governing this code.
;;
(in-package :clim-demo)
" Copyright ( c ) 1992 Symbolics , Inc. All rights reserved . "
(defclass color-chooser-pane (clim-stream-pane) (... | null | https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/demo/color-editor.lisp | lisp | Syntax : ANSI - Common - Lisp ; Package : CLIM - DEMO ; Base : 10 ; Lowercase : Yes -*-
See the file LICENSE for the full license governing this code.
Make sure we don't have a useless cursor blinking away...
Redisplay the color swatch only if we haven't done so
by changing the color in-place |
(in-package :clim-demo)
" Copyright ( c ) 1992 Symbolics , Inc. All rights reserved . "
(defclass color-chooser-pane (clim-stream-pane) ())
(defmethod handle-repaint :after ((stream color-chooser-pane) region)
(declare (ignore region))
(display-color (pane-frame stream) stream))
(define-application-frame co... |
548ac6de3197e4d0414e77356f23eccdc4ed76ea635c8fd5e206158a0dcae74e | xvw/planet | database.mli | (** Exposes static databases *)
open Baremetal
* { 2 API }
type _ t
(** Fetch the path of a database. *)
val path : _ t -> File.name
* { 2 Static databases }
val projects : Shapes.Project.t t
val sectors : Shapes.Sector.t t
val logs : Shapes.Log.t t
val stories : Shapes.Story.t t
val twtxt : Shapes.Twtxt.t t
val ... | null | https://raw.githubusercontent.com/xvw/planet/c2a77ea66f61cc76df78b9c2ad06d114795f3053/src/glue/database.mli | ocaml | * Exposes static databases
* Fetch the path of a database. |
open Baremetal
* { 2 API }
type _ t
val path : _ t -> File.name
* { 2 Static databases }
val projects : Shapes.Project.t t
val sectors : Shapes.Sector.t t
val logs : Shapes.Log.t t
val stories : Shapes.Story.t t
val twtxt : Shapes.Twtxt.t t
val tasks : Shapes.Task.t t
val galleries : Shapes.Gallery.t t
|
59f47cf1df1c1c9e716cbb29a454d462f5d4fa769fbdd556f3dd53a0fabb156b | blambo/accelerate-repa | Traverse.hs | -- |
Module : Data . Array . Accelerate . . Traverse
--
Maintainer : < blambo+ >
--
This module defines data type for use when traversing the Accelerate AST
module Data.Array.Accelerate.Repa.Traverse
( RepaAcc(..)
, RepaExp(..)
, toDoc
)
where
import Text.PrettyPrint
data RepaAcc = Rep... | null | https://raw.githubusercontent.com/blambo/accelerate-repa/5ea4d40ebcca50d5b952e8783a56749cea4431a4/Data/Array/Accelerate/Repa/Traverse.hs | haskell | |
| Module : Data . Array . Accelerate . . Traverse
Maintainer : < blambo+ >
This module defines data type for use when traversing the Accelerate AST
module Data.Array.Accelerate.Repa.Traverse
( RepaAcc(..)
, RepaExp(..)
, toDoc
)
where
import Text.PrettyPrint
data RepaAcc = RepaAcc Doc
d... |
d0acc77e4cbeeb765f3a2dc0f1d25f7072abd84053429fc47e45a030caec2a44 | bkirwi/ethereum-haskell | PathSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE DeriveGeneric #
module Ethereum.Trie.PathSpec(spec) where
import Prelude hiding (seq)
import Data.Aeson
import qualified Data.ByteString as BS
import GHC.Generics
import Ethereum.Prelude
import Ethereum.Trie.Path
import Test.Hspec
import Test.QuickCheck
import Ethereum.T... | null | https://raw.githubusercontent.com/bkirwi/ethereum-haskell/ee995281bad4eed488c174bd8982ed174cfe26af/test/Ethereum/Trie/PathSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DeriveGeneric #
module Ethereum.Trie.PathSpec(spec) where
import Prelude hiding (seq)
import Data.Aeson
import qualified Data.ByteString as BS
import GHC.Generics
import Ethereum.Prelude
import Ethereum.Trie.Path
import Test.Hspec
import Test.QuickCheck
import Ethereum.Testing
data HexCase = HexCase
{ ... |
92e2065b470511ff97fdc786da3d808a775ecafa7bfbbbc3ba103a6e6a46d03c | gklijs/bkes-demo | util.clj | (ns nl.openweb.graphql-endpoint.util
(:require [nl.openweb.topology.value-generator :refer [bytes->uuid uuid->bytes]])
(:import (java.util UUID)
(nl.openweb.data Id)))
(defn new-id
[]
(Id. (uuid->bytes (UUID/randomUUID))))
| null | https://raw.githubusercontent.com/gklijs/bkes-demo/43d78683b41c2c8a1d06ab9fe4e6bea0c67cf16b/graphql-endpoint/src/nl/openweb/graphql_endpoint/util.clj | clojure | (ns nl.openweb.graphql-endpoint.util
(:require [nl.openweb.topology.value-generator :refer [bytes->uuid uuid->bytes]])
(:import (java.util UUID)
(nl.openweb.data Id)))
(defn new-id
[]
(Id. (uuid->bytes (UUID/randomUUID))))
| |
3d8f5c67b3e0d0d9477fd2ca3c158a031bebf907900faa14220ca2810f46df85 | behrica/opencpu-clj | ocpu_test.clj | (ns opencpu-clj.ocpu-test
(:require [midje.sweet :refer [fact facts n-of anything contains has-prefix]]
[opencpu-clj.ocpu :refer [object session package library]]
[opencpu-clj.test-support :refer [server-url j]]))
(fact "can call function which returns session"
(:result (object serv... | null | https://raw.githubusercontent.com/behrica/opencpu-clj/51b83f7b7d143baff86991fecfb113a25ecde709/test/opencpu_clj/ocpu_test.clj | clojure | (fact "can call method from package on cran"
(fact "can call method from github package"
(fact "can list R objects from bioconductor package"
(fact "can get info on user package"
(fact "can execute R gist file" | (ns opencpu-clj.ocpu-test
(:require [midje.sweet :refer [fact facts n-of anything contains has-prefix]]
[opencpu-clj.ocpu :refer [object session package library]]
[opencpu-clj.test-support :refer [server-url j]]))
(fact "can call function which returns session"
(:result (object serv... |
e560228f72dbe6d83bedf5ad26e33ae6a84ebd5c4150a35b25bcfbe18b72df74 | joseferben/clj-aws-sign | core_test.clj | (ns clj-aws-sign.core-test
(:require [clj-aws-sign.core :as sut]
[clj-aws-sign.utils :as u]
[clojure.test :refer :all]
[clojure.string :as s]))
;; Directory where the test suite lives
(def test-suite-dir "suite")
;; Test data, global in whole test suite
(def timestamp "20150830T... | null | https://raw.githubusercontent.com/joseferben/clj-aws-sign/8567c15d0c760288d489237b54679ec884ad55c9/test/clj_aws_sign/core_test.clj | clojure | Directory where the test suite lives
Test data, global in whole test suite | (ns clj-aws-sign.core-test
(:require [clj-aws-sign.core :as sut]
[clj-aws-sign.utils :as u]
[clojure.test :refer :all]
[clojure.string :as s]))
(def test-suite-dir "suite")
(def timestamp "20150830T123600Z")
(def short-timestamp "20150830")
(def region "us-east-1")
(def service ... |
40b3865ede1b3259475e04c1fb8715484115930bcc8c1b134fcc1fb1b3b55b6c | avsm/eeww | flow_meter.ml | — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Copyright ( c ) 2020–2021 < >
Distributed under the MIT license . See terms at the end of this file .
— — — — — — — — — — — — — — — — — — — — — — — — —... | null | https://raw.githubusercontent.com/avsm/eeww/f1f3a5f9c572555cd882f974e2c0cc9b36618a8c/lib/progress/src/progress/engine/flow_meter.ml | ocaml | We need [n + 1] timestamp samples to integrate over [n] values.
Buffer is full. Overwrite the oldest value.
Increase the buffer size | — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Copyright ( c ) 2020–2021 < >
Distributed under the MIT license . See terms at the end of this file .
— — — — — — — — — — — — — — — — — — — — — — — — —... |
0945186f31c92a21c7946fc4ecf542d99928ae54ecac1942b470744ea89d2f24 | rtoy/ansi-cl-tests | simple-array-t.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sun Jan 26 07:23:45 2003
;;;; Contains: Tests of SIMPLE-ARRAY on T element type
(in-package :cl-test)
;;; Tests of (simple-array t)
(deftest simple-array-t.2.1
(notnot-mv (typep #() '(simple-array t)))
t)
(deftest simple-array-t.2.2
(notnot-mv (typep #0aX ... | null | https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/simple-array-t.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of SIMPLE-ARRAY on T element type
Tests of (simple-array t)
Tests of (simple-array t ())
The '1' indicates rank, so this is equivalent to 'vector'
Tests of (simple-array t 0)
Tests of (simple-array t *)
Testing '(simple-array t (--)) | Author :
Created : Sun Jan 26 07:23:45 2003
(in-package :cl-test)
(deftest simple-array-t.2.1
(notnot-mv (typep #() '(simple-array t)))
t)
(deftest simple-array-t.2.2
(notnot-mv (typep #0aX '(simple-array t)))
t)
(deftest simple-array-t.2.3
(notnot-mv (typep #2a(()) '(simple-array t)))
t)
(... |
9c0bbfaeeaf58ec525e41c024b3ca1ce9b38b862bd42de631fd1bb38bbc6ba34 | hiroshi-unno/coar | arithTerm.ml | open Core
open Common.Ext
open LogicOld
module NonLinear = struct
let add_update m t c =
Map.Poly.update m t ~f:(function None -> c | Some c' -> Value.add c c')
let add_monomials m1 m2 = Map.Poly.fold m1 ~init:m2 ~f:(fun ~key ~data m -> add_update m key data)
let mult_update m t c =
Map.Poly.update m t ~... | null | https://raw.githubusercontent.com/hiroshi-unno/coar/90a23a09332c68f380efd4115b3f6fdc825f413d/lib/ast/arithTerm.ml | ocaml | subst_eqterm is substitution of int term.
atom is already normalized.
example for cx = t, ax + u = 0 -> at + cu = 0 | open Core
open Common.Ext
open LogicOld
module NonLinear = struct
let add_update m t c =
Map.Poly.update m t ~f:(function None -> c | Some c' -> Value.add c c')
let add_monomials m1 m2 = Map.Poly.fold m1 ~init:m2 ~f:(fun ~key ~data m -> add_update m key data)
let mult_update m t c =
Map.Poly.update m t ~... |
d7554e63109f7ccae191a3d54889274f12ba85ed64177e396d85550b0fa50dfd | nklein/cl-reactive | if-t.lisp | ;;;; if-t.lisp
(in-package #:cl-reactive/tests)
(nst:def-test-group if-tests ()
(nst:def-test simple-if-test (:values (:equal :yes) (:equal :no))
(signal-let ((sig-cond t :type boolean)
(sig-yes :yes :type symbol)
(sig-no :no :type symbol))
(with-signal-values ((c sig... | null | https://raw.githubusercontent.com/nklein/cl-reactive/e322391f553989add18e6755e810351085c28197/src/if-t.lisp | lisp | if-t.lisp |
(in-package #:cl-reactive/tests)
(nst:def-test-group if-tests ()
(nst:def-test simple-if-test (:values (:equal :yes) (:equal :no))
(signal-let ((sig-cond t :type boolean)
(sig-yes :yes :type symbol)
(sig-no :no :type symbol))
(with-signal-values ((c sig-cond)
... |
1092aeaee95061de44c33fa151f1979fcded713f637c3111d88a9537e35d9d90 | haskell/cabal | cabal.test.hs | import Test.Cabal.Prelude
Uknown language .
main = cabalTest $
fails $ cabal "check" []
| null | https://raw.githubusercontent.com/haskell/cabal/1cfe7c4c7257aa7ae450209d34b4a359e6703a10/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/UnknownLanguage/cabal.test.hs | haskell | import Test.Cabal.Prelude
Uknown language .
main = cabalTest $
fails $ cabal "check" []
| |
1b50f6de3071fe2902781ea97942a7d30e921675c05c760815cb6608e7c0fdb9 | clojure-interop/google-cloud-clients | CloudTasksStubSettings.clj | (ns com.google.cloud.tasks.v2beta2.stub.CloudTasksStubSettings
"Settings class to configure an instance of CloudTasksStub.
The default instance has everything set to sensible defaults:
The default service address (cloudtasks.googleapis.com) and default port (443) are used.
Credentials are acquired automa... | null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.tasks/src/com/google/cloud/tasks/v2beta2/stub/CloudTasksStubSettings.clj | clojure |
" | (ns com.google.cloud.tasks.v2beta2.stub.CloudTasksStubSettings
"Settings class to configure an instance of CloudTasksStub.
The default instance has everything set to sensible defaults:
The default service address (cloudtasks.googleapis.com) and default port (443) are used.
Credentials are acquired automa... |
c1ab842688e9957e544129dec6efa7f55424f086633e610fa24229616c5f23f2 | rm-hull/project-euler | euler078.clj | EULER # 078
;; ==========
;; Let p(n) represent the number of different ways in which n coins can be
separated into piles . For example , five coins can separated into piles
in exactly seven different ways , so p(5)=7 .
;;
OOOO O
OOO OO
;; OOO O O
OO OO O
;; OO O ... | null | https://raw.githubusercontent.com/rm-hull/project-euler/04e689e87a1844cfd83229bb4628051e3ac6a325/src/euler078.clj | clojure | ==========
Let p(n) represent the number of different ways in which n coins can be
OOO O O
OO O O O
O O O O O
| EULER # 078
separated into piles . For example , five coins can separated into piles
in exactly seven different ways , so p(5)=7 .
OOOO O
OOO OO
OO OO O
Find the least value of n for which p(n ) is divisible by one million .
(ns euler078
(:use [util.misc]))
(def sgn (cy... |
b2d3b2b910442d08e8402ce8b0b069784a09c884123c5fd9831a2d37423671c4 | haskell/happy | HappyTemplate.hs | $ I d : GenericTemplate.hs , v 1.26 2005/01/14 14:47:22 simonmar Exp $
#ifdef HAPPY_GHC
# if !defined(__GLASGOW_HASKELL__)
# error `HAPPY_GHC` is defined but this code isn't being built with GHC.
# endif
# define ILIT(n) n#
# define IBOX(n) (Happy_GHC_Exts.I# (n))
# define FAST_INT Happy_GHC_Exts.Int#
Do n... | null | https://raw.githubusercontent.com/haskell/happy/934763408f8df29180c63d7a2c69be0b84030967/packages/backend-lalr/data/HappyTemplate.hs | haskell | nothing
---------------------------------------------------------------------------
starting the parse
---------------------------------------------------------------------------
Accepting the parse
If the current token is ERROR_TOK, it means we've just accepted a partial
parse (a %partial parser). We must ignor... | $ I d : GenericTemplate.hs , v 1.26 2005/01/14 14:47:22 simonmar Exp $
#ifdef HAPPY_GHC
# if !defined(__GLASGOW_HASKELL__)
# error `HAPPY_GHC` is defined but this code isn't being built with GHC.
# endif
# define ILIT(n) n#
# define IBOX(n) (Happy_GHC_Exts.I# (n))
# define FAST_INT Happy_GHC_Exts.Int#
Do n... |
d4d23ba64ad1c2e2cc9bacbe9937350dd58bcc4f1b389e58a89d0ab4c85b4420 | kongo2002/statser | statser_control.erl | Copyright 2017 - 2018
%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distributed under the Li... | null | https://raw.githubusercontent.com/kongo2002/statser/1cb0498f56c97d8a010b979c5163dd2750064e98/src/statser_control.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2017 - 2018
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(statser_control).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
-include("api.hrl").
-include("statser.hrl").
-export([han... |
1dc9ad0a572e30dfc6937e74ea5146315d7b325424055d4f13253ada72bb07eb | keera-studios/Haskelloids | Dust.hs | {-# LANGUAGE Arrows #-}
module Haskelloids.Object.Dust (dustSF,
makeDust
) where
import Control.Arrow (returnA)
import Control.Monad (liftM)
import Control.Monad.Random (RandomGen, Rand, getRandomR)
import FRP.Yampa (Event(..), after, (^<<), integral)
im... | null | https://raw.githubusercontent.com/keera-studios/Haskelloids/781dd915386097b37c8ac9e816dcdf5cb9b8a0be/src/Haskelloids/Object/Dust.hs | haskell | # LANGUAGE Arrows #
doesn't collide with anything | module Haskelloids.Object.Dust (dustSF,
makeDust
) where
import Control.Arrow (returnA)
import Control.Monad (liftM)
import Control.Monad.Random (RandomGen, Rand, getRandomR)
import FRP.Yampa (Event(..), after, (^<<), integral)
import Haskelloids.Geometr... |
5cfe897e895bd6fb81b62d7d758e6dde30e05472b4104044ef52320da1c36b99 | zkincaid/srk | ring.mli | (** Operations on rings. *)
(** Sparse vectors of infinite dimension. *)
module type Vector = sig
type t
type dim
type scalar
(** Vector equality. *)
val equal : t -> t -> bool
(** Vector addition. *)
val add : t -> t -> t
(** Multiply a vector by a scalar. *)
val scalar_mul : scalar -> t -> t
... | null | https://raw.githubusercontent.com/zkincaid/srk/4809f2b697c02d9e020e4de2c0b11ff4a0c59f7f/src/ring.mli | ocaml | * Operations on rings.
* Sparse vectors of infinite dimension.
* Vector equality.
* Vector addition.
* Multiply a vector by a scalar.
* Additive inverse of a vector.
* Vector subtraction.
* Inner product: [dot u v = sum_i (u_i * v_i)].
* [add_term a i v] adds [a] to the [i]th position of [v].
* [of_term a i] i... |
module type Vector = sig
type t
type dim
type scalar
val equal : t -> t -> bool
val add : t -> t -> t
val scalar_mul : scalar -> t -> t
val negate : t -> t
val sub : t -> t -> t
val dot : t -> t -> scalar
* The vector with all zero entries .
val zero : t
* Is the given vector the zero vecto... |
09a273d2046e1cc03c2564522647645828c7ad3db53d5443294e5a484f4689e1 | kaoskorobase/mescaline | Hash.hs | # LANGUAGE GeneralizedNewtypeDeriving #
module Mescaline.Database.Hash (
Hash
, fromString
, toString
, fromData
, fromFile
, noHash
) where
import Data.Binary (Binary(..))
import Control.DeepSeq (NFData(..))
import Control.Monad
import Data.Char
import qualified D... | null | https://raw.githubusercontent.com/kaoskorobase/mescaline/13554fc4826d0c977d0010c0b4fb74ba12ced6b9/lib/mescaline-database/Mescaline/Database/Hash.hs | haskell | instance Show Hash where
show h = "fromString " ++ show (toString h)
| Construct a 'Hash' from a hex encoded string.
| Convert a Hash to a hex encoded string.
| Construct a Hash from data.
| Construct a Hash from a file. | # LANGUAGE GeneralizedNewtypeDeriving #
module Mescaline.Database.Hash (
Hash
, fromString
, toString
, fromData
, fromFile
, noHash
) where
import Data.Binary (Binary(..))
import Control.DeepSeq (NFData(..))
import Control.Monad
import Data.Char
import qualified D... |
40ac35ec1e7bc55ee5a5ba53feeaede1f3f9164a7a2f5ef7cd9ed76145275fb3 | music-suite/music-score | PairMonad.hs |
# LANGUAGE
CPP ,
StandaloneDeriving ,
DeriveFoldable ,
DeriveTraversable #
CPP,
StandaloneDeriving,
DeriveFoldable,
DeriveTraversable #-}
module Data.PairMonad where
import Control.Applicative
-- #ifdef __HAS_LENS__
import Control.Lens()
-- #endif __HAS_LENS__
import Data.Mo... | null | https://raw.githubusercontent.com/music-suite/music-score/aa7182d8ded25c03a56b83941fc625123a7931f8/src/Data/PairMonad.hs | haskell | #ifdef __HAS_LENS__
#endif __HAS_LENS__
Equivalent to the Monad Writer instance.
The following is provided by Data.Orphans
instance Monoid o => Monad ((,) o) where
return = pure
(o,a) >>= f = (o `mappend` o', a') where (o',a') = f a
#ifndef __HAS_LENS__
deriving instance Foldable ((,) o)
#endif __HAS... |
# LANGUAGE
CPP ,
StandaloneDeriving ,
DeriveFoldable ,
DeriveTraversable #
CPP,
StandaloneDeriving,
DeriveFoldable,
DeriveTraversable #-}
module Data.PairMonad where
import Control.Applicative
import Control.Lens()
import Data.Monoid
import Data.Foldable
import Data.Orphans ... |
301be466b70fb7992522bface2bb47a4f330c12fd4496b5004e136c3a2f52525 | tschady/advent-of-code | d12_test.clj | (ns aoc.2020.d12-test
(:require [aoc.2020.d12 :as sut]
[clojure.test :refer :all]))
(deftest challenges
(is (= 1956 (sut/part-1 sut/input)))
(is (= 126797 (sut/part-2 sut/input))))
| null | https://raw.githubusercontent.com/tschady/advent-of-code/1e4a95ef580c3bf635837eff52aa998b0acfc666/test/aoc/2020/d12_test.clj | clojure | (ns aoc.2020.d12-test
(:require [aoc.2020.d12 :as sut]
[clojure.test :refer :all]))
(deftest challenges
(is (= 1956 (sut/part-1 sut/input)))
(is (= 126797 (sut/part-2 sut/input))))
| |
cf5257416bf02f6b58ee3a75c9f47f8d16e7c66bb186cb8abee7c5bef65e45e6 | synduce/Synduce | gradient.ml |
let j0 a (b0, b1) (c0, c1) = (((b0 && c0) && (a > b1)) && (a > c1), a)
let s0 x = (x > 0, x)
let rec target =
function Leaf(a) -> s0 a | Node(a, l, r) -> j0 a (target l) (target r)
| null | https://raw.githubusercontent.com/synduce/Synduce/289888afb1c312adfd631ce8d90df2134de827b8/extras/solutions/tree/gradient.ml | ocaml |
let j0 a (b0, b1) (c0, c1) = (((b0 && c0) && (a > b1)) && (a > c1), a)
let s0 x = (x > 0, x)
let rec target =
function Leaf(a) -> s0 a | Node(a, l, r) -> j0 a (target l) (target r)
| |
2e75671019a3bf16839a6e9f83b85edc5c664e2b30e7412c8f8623783f9729e1 | OCamlPro/ocp-indent | indentExtend.ml | (**************************************************************************)
(* *)
(* All rights reserved.This file is distributed under the terms of the *)
GNU Lesser General Public License version 2.1 with linking
(* exception. ... | null | https://raw.githubusercontent.com/OCamlPro/ocp-indent/9e26c0a2699b7076cebc04ece59fb354eb84c11c/src/indentExtend.ml | ocaml | ************************************************************************
All rights reserved.This file is distributed under the terms of the
exception.
... | GNU Lesser General Public License version 2.1 with linking
is distributed in the hope that it will be useful ,
exception Syntax_not_found of string
type t = {
keywords : (string * Approx_tokens.token) list;
lexer : (Lexing.lexbuf -> Approx_tokens.token) option
}
let extensions = Ha... |
a9b69b2e8a6afa5f115c264d23405599d1823f056acd0111bba94665c4d9a0dc | eeng/shevek | configuration_test.clj | (ns shevek.acceptance.configuration-test
(:require [clojure.test :refer [deftest use-fixtures is testing]]
[shevek.acceptance.test-helper :refer [wrap-acceptance-tests it login-admin click click-text visit fill fill-by-name has-css? has-text? click-tid select has-no-text?]]
[shevek.makers :ref... | null | https://raw.githubusercontent.com/eeng/shevek/7783b8037303b8dd5f320f35edee3bfbb2b41c02/test/clj/shevek/acceptance/configuration_test.clj | clojure | (ns shevek.acceptance.configuration-test
(:require [clojure.test :refer [deftest use-fixtures is testing]]
[shevek.acceptance.test-helper :refer [wrap-acceptance-tests it login-admin click click-text visit fill fill-by-name has-css? has-text? click-tid select has-no-text?]]
[shevek.makers :ref... | |
fda41bec11ed93e68ea450f86547ed90619780636afab87639ece3b9071523a9 | liamoc/dixi | Config.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE RecordWildCards #
{-# LANGUAGE QuasiQuotes #-}
module Dixi.Config ( Config (Config, port, storage, static, stylesheet)
, Renders (..)
, defaultConfig
, configToRenders
, defaultRenders
... | null | https://raw.githubusercontent.com/liamoc/dixi/4a2aeef11378adf63ddf3d5787611e49220d6f6e/Dixi/Config.hs | haskell | # LANGUAGE QuasiQuotes #
generic
generic
generic
generic | # LANGUAGE DeriveGeneric #
# LANGUAGE RecordWildCards #
module Dixi.Config ( Config (Config, port, storage, static, stylesheet)
, Renders (..)
, defaultConfig
, configToRenders
, defaultRenders
, EndoIO (..)
... |
fbf79d67f2894daa6c61205a906e6cdcf27fe530059e29a1872154709f2199bf | lisp-korea/sicp2014 | ex-2-31.scm | ex 2.31
abstract ex 2.31 's square - tree and
; define high-order procedure tree-map
(define (square x) (* x x))
(define (tree-map f tree)
(define (recur t)
(cond ((null? t) '())
((not (pair? t)) (f t))
(else (map recur t))))
(recur tree))
(define (square-tree tree) (tree-map square t... | null | https://raw.githubusercontent.com/lisp-korea/sicp2014/9e60f70cb84ad2ad5987a71aebe1069db288b680/vvalkyrie/2.2/ex-2-31.scm | scheme | define high-order procedure tree-map | ex 2.31
abstract ex 2.31 's square - tree and
(define (square x) (* x x))
(define (tree-map f tree)
(define (recur t)
(cond ((null? t) '())
((not (pair? t)) (f t))
(else (map recur t))))
(recur tree))
(define (square-tree tree) (tree-map square tree))
(square-tree (list 1 (list 2 (li... |
9efda581d5f6c05fed8199508ee62aaf5eb174fbf5d669952d82ea8af80a190f | jaspervdj/hakyll | test.hs | {-# LANGUAGE BangPatterns #-}
import Control.Monad (forM)
import qualified Data.ByteString.Base16 as Base16
import qualified Data.ByteString.Char8 as BS8
import qualified Data.ByteString.Lazy as BSL
import qualified Data.Hashable as DH
import Data.Map (Map)
import ... | null | https://raw.githubusercontent.com/jaspervdj/hakyll/122dd424891f6c9be15ff5225886484386dd0956/test.hs | haskell | # LANGUAGE BangPatterns # | import Control.Monad (forM)
import qualified Data.ByteString.Base16 as Base16
import qualified Data.ByteString.Char8 as BS8
import qualified Data.ByteString.Lazy as BSL
import qualified Data.Hashable as DH
import Data.Map (Map)
import qualified Data.Map ... |
12e7c964a1f9b1c93c83e01f519980b03ca61377278d398612dfb27b155830d0 | 0install/0install | pk_service.ml | Copyright ( C ) 2013 , the README file for details , or visit .
* See the README file for details, or visit .
*)
(* A dummy PackageKit for unit-tests *)
open Support
open Support.Common
module U = Support.Utils
module D = Zeroinstall.Dbus
open D.OBus_object
let start version : (unit -> unit) Lwt.t =
... | null | https://raw.githubusercontent.com/0install/0install/b3d7e5fdabb42c495c0ba3a97056b21264064f4f/src/tests/pk_service.ml | ocaml | A dummy PackageKit for unit-tests
(must be sorted)
Create the objects
Attach the data
Export the object on the connection | Copyright ( C ) 2013 , the README file for details , or visit .
* See the README file for details, or visit .
*)
open Support
open Support.Common
module U = Support.Utils
module D = Zeroinstall.Dbus
open D.OBus_object
let start version : (unit -> unit) Lwt.t =
D.OBus_bus.system () >>= fun bus ->
... |
3bb44e6e9a10a6d07938862e003cca476e06a3933c308d18b3c6562f6e0bf227 | patricoferris/ocaml-multicore-monorepo | multipart_form_lwt.mli | open Multipart_form
(** {3 Streaming API.} *)
val stream :
?bounds:int ->
identify:(Header.t -> 'id) ->
string Lwt_stream.t ->
Content_type.t ->
[ `Parse of ('id t, [> `Msg of string ]) result Lwt.t ]
* ('id * Header.t * string Lwt_stream.t) Lwt_stream.t
* [ stream ~identify ] returns :
- a promis... | null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/multipart_form/lib_lwt/multipart_form_lwt.mli | ocaml | * {3 Streaming API.}
* [of_stream_to_tree stream content_type] returns, if it succeeds, a value
{!t} representing the multipart document, where the contents of the parts are
stored as strings. It is equivalent to [of_stream_to_list] where references
have been replaced with their associated contents. | open Multipart_form
val stream :
?bounds:int ->
identify:(Header.t -> 'id) ->
string Lwt_stream.t ->
Content_type.t ->
[ `Parse of ('id t, [> `Msg of string ]) result Lwt.t ]
* ('id * Header.t * string Lwt_stream.t) Lwt_stream.t
* [ stream ~identify ] returns :
- a promise [ th ] about the parser ... |
6dfe46ee2c5da4ab05db791f3d57c575103318b463e6087330a067346c3a0028 | charlieg/Sparser | loader.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
copyright ( c ) 1991 Content Technologies Inc.
copyright ( c ) 1992 -- all rights reserved
;;;
;;; File: "loader"
;;; Module: "interface;AssetNet:"
version : January 1992
(in-package :sparser)
(lload "AssetNet;parameters")
(lloa... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/interface/AssetNet/loader.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
File: "loader"
Module: "interface;AssetNet:" | copyright ( c ) 1991 Content Technologies Inc.
copyright ( c ) 1992 -- all rights reserved
version : January 1992
(in-package :sparser)
(lload "AssetNet;parameters")
(lload "AssetNet;traces")
(lload "AssetNet;time")
(lload "AssetNet;get file")
(lload "AssetNet;message")
(lload "AssetNet;file link")
(l... |
5d4c269ad6236876621192243f8172a1443ca9505d7dfae65705f69594288754 | scheme/edwin48 | fixnum.scm | ;;;
operations
;;;
(define (fix:= a b) (= a b))
(define (fix:< a b) (< a b))
(define (fix:> a b) (> a b))
(define (fix:<= a b) (<= a b))
(define (fix:>= a b) (>= a b))
(define (fix:fixnum? n) (integer? n))
(define (fix:zero? n) (zero? n))
(define (fix:positive? n) (positive? n))
(define (fix:negative? n... | null | https://raw.githubusercontent.com/scheme/edwin48/fbe3c7ca14f1418eafddebd35f78ad12e42ea851/edwin48/scsh/fixnum.scm | scheme | operations
(define (fix:= a b) (= a b))
(define (fix:< a b) (< a b))
(define (fix:> a b) (> a b))
(define (fix:<= a b) (<= a b))
(define (fix:>= a b) (>= a b))
(define (fix:fixnum? n) (integer? n))
(define (fix:zero? n) (zero? n))
(define (fix:positive? n) (positive? n))
(define (fix:negative? n) (negat... | |
30322dca245d0adcbd1d0abc6e318ce36dfd16409cda41e6775bbe3ee998515b | tsloughter/rebar3_tests | dialyzer_test_sup.erl | %%%-------------------------------------------------------------------
%% @doc dialyzer_test top level supervisor.
%% @end
%%%-------------------------------------------------------------------
-module('dialyzer_test_sup').
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% Supervisor callbacks
-export([ini... | null | https://raw.githubusercontent.com/tsloughter/rebar3_tests/090bfef7d3a4790bb6b16e4c38df6e4c0460b4b2/dialyzer_test/src/dialyzer_test_sup.erl | erlang | -------------------------------------------------------------------
@doc dialyzer_test top level supervisor.
@end
-------------------------------------------------------------------
API
Supervisor callbacks
====================================================================
API functions
=========================... |
-module('dialyzer_test_sup').
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(SERVER, ?MODULE).
start_link() ->
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
Child : : { Id , StartFunc , Restart , Shutdown , Type , Modules }
init([]) ->
{ok, { {one_for_all, 0, 1}, ... |
276f26d12a392b5525b83e50e3270f7083b44144757f1950cc6606889bbb9e2e | ocaml/dune | dune_engine.ml | module Display = Display
module Vcs = Vcs
module Context_name = Context_name
module Action_builder = Action_builder
module Dep = Dep
module Package = Package
module Action = Action
module Utils = Utils
module Dir_set = Dir_set
module Subdir_set = Subdir_set
module Dialect = Dialect
module Dune_project = Dune_project
mo... | null | https://raw.githubusercontent.com/ocaml/dune/4e83d1b80bd9a37de7e0d39d6f22873850314557/src/dune_engine/dune_engine.ml | ocaml | module Display = Display
module Vcs = Vcs
module Context_name = Context_name
module Action_builder = Action_builder
module Dep = Dep
module Package = Package
module Action = Action
module Utils = Utils
module Dir_set = Dir_set
module Subdir_set = Subdir_set
module Dialect = Dialect
module Dune_project = Dune_project
mo... | |
16498089681b9bfd7f97bcfd88b1dc14f8a1e374eadc4f460f401d0a9039af33 | jellelicht/guix | node.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2014 < >
Copyright © 2015 < >
Copyright © 2015 < >
;;;
;;; 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 Fre... | null | https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/gnu/packages/node.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 © 2014 < >
Copyright © 2015 < >
Copyright © 2015 < >
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 packages node)
#:use-module ((guix licen... |
05c9be423f21c97a3dcce8a2cb2760b523cca343ed32541678b8ad9c16e0bc64 | jackfirth/resyntax | let-binding-suggestions-function-shortcuts-test.rkt | #lang resyntax/testing/refactoring-test
require: resyntax/default-recommendations let-binding-suggestions
header:
- #lang racket/base
test: "let binding to lambda"
------------------------------
(define (f)
(let ([g (λ (x y) 1)])
1))
------------------------------
------------------------------
(define (f)
... | null | https://raw.githubusercontent.com/jackfirth/resyntax/7fc36a29268f1210efa840c587881ad3fb4286e5/default-recommendations/let-binding-suggestions-function-shortcuts-test.rkt | racket | #lang resyntax/testing/refactoring-test
require: resyntax/default-recommendations let-binding-suggestions
header:
- #lang racket/base
test: "let binding to lambda"
------------------------------
(define (f)
(let ([g (λ (x y) 1)])
1))
------------------------------
------------------------------
(define (f)
... | |
40d7409d47d626507e096d5d30903c4f0b59e528f431d1dafbe75bfb54fcf27f | typelead/etlas | Strip.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE RankNTypes #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Program.Strip
--
-- Maintainer :
-- Portability : portable
--
This module provides an library interface to the @strip@ program .
modu... | null | https://raw.githubusercontent.com/typelead/etlas/bbd7c558169e1fda086e759e1a6f8c8ca2807583/etlas-cabal/Distribution/Simple/Program/Strip.hs | haskell | # LANGUAGE RankNTypes #
---------------------------------------------------------------------------
|
Module : Distribution.Simple.Program.Strip
Maintainer :
Portability : portable
Don't bother warning on windows, we don't expect them to
have the strip program anyway.
some OS X installations causes:
... | # LANGUAGE FlexibleContexts #
This module provides an library interface to the @strip@ program .
module Distribution.Simple.Program.Strip (stripLib, stripExe)
where
import Prelude ()
import Distribution.Compat.Prelude
import Distribution.Simple.Program
import Distribution.Simple.Utils
import Distribution.S... |
72b87279a0b9ee5d5e072a9973a9bea3905b36a7ad1b7ec5cd21d016094f7ec4 | brendanhay/amazonka | RuleSummary.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived fr... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-wafv2/gen/Amazonka/WAFV2/Types/RuleSummary.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Module : Amazonka.WAFV2.Types.RuleSummary
Stability : auto-generated
| High-level information about a Rule, returned by operations like
DescribeManagedRuleGroup. This provides information like the ID, that
provide to the RuleGroupReferenceStatement t... | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived from AWS service descriptions , licensed under Apache 2.0 .
Co... |
e546e0d409dcdb76e21ff1b467dec45b902285cca7bf36ee4a396f4f0e2544c6 | ralexstokes/stoken | dev.clj | (ns dev
"Tools for interactive development with the REPL. This file should
not be included in a production build of the application.
Call `(reset)` to reload modified code and (re)start the system.
The system under development is `system`, referred from
`com.stuartsierra.component.repl/system`.
See also ... | null | https://raw.githubusercontent.com/ralexstokes/stoken/b88adb36ffa1e9f3099925634eb1f98beb986442/dev/dev.clj | clojure | Do not try to load source code from 'resources' directory
some convenience data for development
NOTE this threshold is primarily intended for a single peer, for development; some race conditions appear with multiple nodes on a single device with this difficulty that would be highly unlikely on a public network
mine... | (ns dev
"Tools for interactive development with the REPL. This file should
not be included in a production build of the application.
Call `(reset)` to reload modified code and (re)start the system.
The system under development is `system`, referred from
`com.stuartsierra.component.repl/system`.
See also ... |
3b7b85914fffa25862a4a467e73cd86c23cf145e7ce1e720ad9b05f9f1c72487 | rogerallen/qeom | q000.clj | ;; inspiration
;; -camouflage-a-new-minimal-geometric
(ns qeom.q000
(:use quil.core))
(set! *warn-on-reflection* true)
(defn fract [v]
(- v (int v)))
(defn random-long ^long [a b]
(long (random a b)))
(defn random-bool []
(= 1 (int (random 0 2))))
(defn setup []
(smooth)
(frame-rate 30)
(stroke 0 0)... | null | https://raw.githubusercontent.com/rogerallen/qeom/ba767f457dee4a709dcaa4a2f3b6843190592499/src/qeom/q000.clj | clojure | inspiration
-camouflage-a-new-minimal-geometric |
(ns qeom.q000
(:use quil.core))
(set! *warn-on-reflection* true)
(defn fract [v]
(- v (int v)))
(defn random-long ^long [a b]
(long (random a b)))
(defn random-bool []
(= 1 (int (random 0 2))))
(defn setup []
(smooth)
(frame-rate 30)
(stroke 0 0)
(stroke-weight 0))
(defn random-fill []
(case (r... |
450a3caea4441edafa4565ef4ec6ab6c5411af12590e9700d8c3d5dc13aa9152 | clojure-interop/google-cloud-clients | CloudStoragePseudoDirectoryException.clj | (ns com.google.cloud.storage.contrib.nio.CloudStoragePseudoDirectoryException
"Exception thrown when erroneously trying to operate on a path with a trailing slash."
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.storage.contrib.nio CloudStoragePseudoDirectoryException]))
| null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.storage/src/com/google/cloud/storage/contrib/nio/CloudStoragePseudoDirectoryException.clj | clojure | (ns com.google.cloud.storage.contrib.nio.CloudStoragePseudoDirectoryException
"Exception thrown when erroneously trying to operate on a path with a trailing slash."
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.storage.contrib.nio CloudStoragePseudoDirectoryException]))
| |
a168896c2ad1b69f0cd07a3309631310dfd7fb235b18b39f24df193bd77251ec | bufferswap/ViralityEngine | flows.lisp | (in-package #:virality)
(define-call-flow :default ()
(flow initialize-phase
(flow-state entry/initialize-phase :reset ()
(selector nil)
(action nil)
(transition pending-tasks))
;; High level description of this flow:
0 . If pre - init is ... | null | https://raw.githubusercontent.com/bufferswap/ViralityEngine/df7bb4dffaecdcb6fdcbfa618031a5e1f85f4002/src/definition/flows.lisp | lisp | High level description of this flow:
make a decision:
Running PROTOCOL-INITIALIZE-COMPONENTS may have caused
additional actors/components to be created, so we
check for that here and repeat as needed.
Then do the process over again.
Or exit this phase, we're done initializing.
NOTE: We don't call comp::proce... | (in-package #:virality)
(define-call-flow :default ()
(flow initialize-phase
(flow-state entry/initialize-phase :reset ()
(selector nil)
(action nil)
(transition pending-tasks))
0 . If pre - init is empty , go to 7 .
1 . straight up move compone... |
4754bfba03bee1af2dbfad3ab4f0f0380a916a0f5f1e9db625ee3ffc45c68a8e | nsg-ethz/O4 | base.rkt | #lang racket/base
; Base Context
; ---------------------------------------
(provide context
add-scope
remove-scope
get-declare
get-declares-of-scope
get-calls-of-scope
set-declare
set-call
remove-call)
; Implementation
; -------------------------... | null | https://raw.githubusercontent.com/nsg-ethz/O4/870f6f78a6f7bb1e9e1502e29ff0048e5e1723c5/o4/context/base.rkt | racket | Base Context
---------------------------------------
Implementation
---------------------------------------
Struct
-
In declares, we store declared variables, factories, parameters, etc.
In calls, we store factory calls.
-
This function adds a new scope to the context e.g. at the beginning of a block statemen... | #lang racket/base
(provide context
add-scope
remove-scope
get-declare
get-declares-of-scope
get-calls-of-scope
set-declare
set-call
remove-call)
(require racket/hash
o4/utils/util)
(struct context (next declares calls) #:mutable #:trans... |
5f62a4cebfd250a2984fa1b78aad5c012ae2669e3d8335d6853abcf239076fa0 | bennn/dissertation | sample-preview.rkt | #lang racket/base
;; plot samples together
(require file/glob racket/format pict pict-abbrevs)
(define bm* '(take5 tetris synth quadU quadT))
(define (glob1 pat)
(define m* (glob pat))
(if (or (null? m*) (not (null? (cdr m*))))
(raise-argument-error 'glob1 "die" pat)
(car m*)))
(for ((dir (in-list (lis... | null | https://raw.githubusercontent.com/bennn/dissertation/779bfe6f8fee19092849b7e2cfc476df33e9357b/dissertation/scrbl/validate-sample/sample-preview.rkt | racket | plot samples together | #lang racket/base
(require file/glob racket/format pict pict-abbrevs)
(define bm* '(take5 tetris synth quadU quadT))
(define (glob1 pat)
(define m* (glob pat))
(if (or (null? m*) (not (null? (cdr m*))))
(raise-argument-error 'glob1 "die" pat)
(car m*)))
(for ((dir (in-list (list "sample-avg" "sample"))... |
b0a1c170ef7d1605eec07106e376d63128655394482a035d1ed79efc08a6637f | jiangpengnju/htdp2e | word-games-the-heart.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-abbr-reader.ss" "lang")((modname word-games-the-heart.v1) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructo... | null | https://raw.githubusercontent.com/jiangpengnju/htdp2e/d41555519fbb378330f75c88141f72b00a9ab1d3/arbitrarily-large-data/extended-exercises-lists/word-games-the-heart.v1.rkt | racket | about the language level of this file in a form that our tools can easily process.
The goal of this section is to design the function arrangements,
letter-by-letter rearrangements.
constants
On OS X:
A Word is one of:
- '()
(cons 1String Word)
interpretation: a String as a list of single Strings (letters)
- '... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname word-games-the-heart.v1) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
a function that consumes a Word and produ... |
ced0439236620fe70cdc662bf2081c5d58f7eedc2093013b74880ced15452d27 | WorksHub/client | company.cljc | (ns wh.components.activities.company
(:require [wh.common.specs.company :as company-spec]
[wh.common.url :as url]
[wh.components.activities.components :as components]
[wh.routes :as routes]))
(defn details [{:keys [name tags slug description size locations] :as company} entity-typ... | null | https://raw.githubusercontent.com/WorksHub/client/28a7699bd0a122ae3ae7ef473105cc05578918d8/common/src/wh/components/activities/company.cljc | clojure | (ns wh.components.activities.company
(:require [wh.common.specs.company :as company-spec]
[wh.common.url :as url]
[wh.components.activities.components :as components]
[wh.routes :as routes]))
(defn details [{:keys [name tags slug description size locations] :as company} entity-typ... | |
7931ebd3603d61251c3236787a3cd00fccf76f40c3529b611ea431e23822425f | rbuchmann/samak | testing_tools.cljc | (ns samak.testing-tools
(:require [samak.lisparser :as lp]))
(def example-program
"(def foo inc)
(def bar dec)
(def baz 5)
(def input (pipes/debug))
(def pipe (| input (-> foo bar) baz))")
(def parsed-example
(lp/parse-all example-program))
| null | https://raw.githubusercontent.com/rbuchmann/samak/ab98d1a180ee02c6cd784962b3c03e473a6d481b/test/samak/testing_tools.cljc | clojure | (ns samak.testing-tools
(:require [samak.lisparser :as lp]))
(def example-program
"(def foo inc)
(def bar dec)
(def baz 5)
(def input (pipes/debug))
(def pipe (| input (-> foo bar) baz))")
(def parsed-example
(lp/parse-all example-program))
| |
d396c2ff74d5957cf8a2257762f553d34b62c332e1d45c958636a26136ff407b | hiratara/Haskell-Nyumon-Sample | Register.hs | {-# LANGUAGE OverloadedStrings #-}
-- src/Web/Action/Register.hs
module Web.Action.Register (registerAction) where
import Control.Monad (when)
import Model.User (NewUser (NewUser), insertUser)
import Web.Core (WRAction, runSqlite)
import Web.Spock (param')
import Web.View.Start (startView)
registerAc... | null | https://raw.githubusercontent.com/hiratara/Haskell-Nyumon-Sample/ac52b741e3b96722f6fc104cfa84078e39f7a241/chap10-samples/src/Web/Action/Register.hs | haskell | # LANGUAGE OverloadedStrings #
src/Web/Action/Register.hs
paramで値を取り出す。
未入力項目があれば入力を促す。
INSERT失敗時に登録失敗を返す。 |
module Web.Action.Register (registerAction) where
import Control.Monad (when)
import Model.User (NewUser (NewUser), insertUser)
import Web.Core (WRAction, runSqlite)
import Web.Spock (param')
import Web.View.Start (startView)
registerAction :: WRAction a
registerAction = do
password <- param' "pass... |
e3b11befc27ce52fb9070f491d9f2c14b412a679c2a796acb75fb30f86461300 | inaka/erlang_guidelines | export_all.erl | -module(export_all).
-compile(export_all). % Avoid, better to do
% -export([real_fun/0, other_fun/0]).
real_fun() -> does_something.
other_fun() -> does_something_else.
| null | https://raw.githubusercontent.com/inaka/erlang_guidelines/7a802a23a08d120db7e94115b4600b26194dd242/src/export_all.erl | erlang | Avoid, better to do
-export([real_fun/0, other_fun/0]). | -module(export_all).
real_fun() -> does_something.
other_fun() -> does_something_else.
|
4b9ecdc3bc5815c7ddc619099c82accbeddd8f5209b4e2922660829ab8e58ff7 | facebookarchive/pfff | org_mode.ml |
*
* Copyright ( C ) 2010 Facebook
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU General Public License ( GPL )
* version 2 as published by the Free Software Foundation .
*
* This program is distributed in the hope that it will be us... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_text/org_mode.ml | ocaml | ***************************************************************************
Prelude
***************************************************************************
***************************************************************************
Types
**************************************************************************... |
*
* Copyright ( C ) 2010 Facebook
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU General Public License ( GPL )
* version 2 as published by the Free Software Foundation .
*
* This program is distributed in the hope that it will be us... |
9682f49604cf544bd56276994227da00e2832ec3dc6afd1de6def250b59c765f | juspay/atlas | DriverTrackingHealthcheck.hs | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/atlas-transport/src/App/DriverTrackingHealthcheck.hs | haskell | default manager is created | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... |
c9cc45786c43b2c2faf587fec925fe0a4e14c5bd50ef41725ad82e1ca17f9944 | ocamllabs/ocaml-modular-implicits | pr6123_bad.ml | class virtual name =
object
end
and func (args_ty, ret_ty) =
object(self)
inherit name
val mutable memo_args = None
method arguments =
match memo_args with
| Some xs -> xs
| None ->
let args = List.map (fun ty -> new argument(self, ty)) args_ty in
memo_args <- Some args; args
end
and... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/typing-objects/pr6123_bad.ml | ocaml | class virtual name =
object
end
and func (args_ty, ret_ty) =
object(self)
inherit name
val mutable memo_args = None
method arguments =
match memo_args with
| Some xs -> xs
| None ->
let args = List.map (fun ty -> new argument(self, ty)) args_ty in
memo_args <- Some args; args
end
and... | |
7a9c44264d239419570322318ef50ea4b674b64d58c3b1fd8bf8dac5ac3962ce | inria-parkas/sundialsml | intro2.ml | #use "topfind";;
#require "sundialsml.mpi";;
let comm = Mpi.comm_world
let n = Mpi.comm_size comm
let my_id = Mpi.comm_rank comm
let pv = Nvector_parallel.make 1 n comm (float_of_int (my_id + 1));;
Printf.printf "%d: local=%f.\n" my_id (Nvector_parallel.local_array pv).{0};;
Printf.printf "Sum of abs. = %f\n" (Nvecto... | null | https://raw.githubusercontent.com/inria-parkas/sundialsml/b1e07d7ef6184a441faf925841bf9a04d7cf94ea/examples/ocaml/skeletons/intro2.ml | ocaml | #use "topfind";;
#require "sundialsml.mpi";;
let comm = Mpi.comm_world
let n = Mpi.comm_size comm
let my_id = Mpi.comm_rank comm
let pv = Nvector_parallel.make 1 n comm (float_of_int (my_id + 1));;
Printf.printf "%d: local=%f.\n" my_id (Nvector_parallel.local_array pv).{0};;
Printf.printf "Sum of abs. = %f\n" (Nvecto... | |
11196def091a239dc4f3777f06f55b9ac224e539dd920e8ee264de65133eaa97 | ocaml/opam-file-format | opamPrinter.mli | (**************************************************************************)
(* *)
Copyright 2012 - 2020 OCamlPro
Copyright 2012 INRIA
(* ... | null | https://raw.githubusercontent.com/ocaml/opam-file-format/007cda4d02718052e5998dc34cade69f8b487fd2/src/opamPrinter.mli | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2012 - 2020 OCamlPro
Copyright 2012 INRIA
GNU Lesser General Public License version 2.1 , with the special
module FullPos : sig
open OpamParserTypes.FullPos
* { 2 Printers for the [ value ] and [... |
800a6071b4beb37a2d72745f662dca223b09da12df96a5e52b1307e2dad1bb7a | gedge-platform/gedge-platform | rabbit_routing_util.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 ) 2013 - 2021 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(rabbit_routing_util).
-export([init_stat... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/amqp_client/src/rabbit_routing_util.erl | erlang |
----------------------------------------------------------------------------
--------------------------------------------------------------------------
--------------------------------------------------------------------------
--------------------------------------------------------------------------
i.e., we sho... | 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 ) 2013 - 2021 VMware , Inc. or its affiliates . All rights reserved .
-module(rabbit_routing_util).
-export([init_state/0, d... |
676378826d83a0977f90cbcd55a6a4011eec449c75b98bcc32ac01a7dd3bc5b3 | shop-planner/shop3 | Log_ran_problems_50.lisp | name : Log_ran_problems.lisp
# packages : 50 # citys : NUM_CITY
# planes : 10 seed:931112302
;;--------------------------------------
(in-package :shop-user)
(defproblem log-ran-50-1 logistics
(
(AIRPLANE plane1)
(airplane-at plane1 LOC5-1)
(AIRPLANE plane2)
(airplane-at plane2 LOC15-1)
(AIRPLANE plan... | null | https://raw.githubusercontent.com/shop-planner/shop3/ba429cf91a575e88f28b7f0e89065de7b4d666a6/shop3/examples/logistic/Log_ran_problems_50.lisp | lisp | --------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------------------------------------
--------... | name : Log_ran_problems.lisp
# packages : 50 # citys : NUM_CITY
# planes : 10 seed:931112302
(in-package :shop-user)
(defproblem log-ran-50-1 logistics
(
(AIRPLANE plane1)
(airplane-at plane1 LOC5-1)
(AIRPLANE plane2)
(airplane-at plane2 LOC15-1)
(AIRPLANE plane3)
(airplane-at plane3 LOC23-1)
(AIRPL... |
d8f4f1d15b854319aff555da7514bde7241b7c9e900b1ac34a51c2652fdc0ebb | c-cube/jsonrpc2 | test_server.ml | module J = Decoders_yojson.Safe
module R = Jsonrpc2_sync
let debug = ref (try ignore (Sys.getenv "DEBUG"); true with _ -> false)
let get_err = function
| Ok x -> x
| Error e ->
if !debug then Printf.eprintf "got error: %s\n%!" (Printexc.to_string e);
raise e
module Server = struct
let sum (c:R.t) (l:in... | null | https://raw.githubusercontent.com/c-cube/jsonrpc2/c230d056c8084435b0d681f1be5cc15a0fba834b/tests/test_server.ml | ocaml | set offset | module J = Decoders_yojson.Safe
module R = Jsonrpc2_sync
let debug = ref (try ignore (Sys.getenv "DEBUG"); true with _ -> false)
let get_err = function
| Ok x -> x
| Error e ->
if !debug then Printf.eprintf "got error: %s\n%!" (Printexc.to_string e);
raise e
module Server = struct
let sum (c:R.t) (l:in... |
f348a6c2cf4d75b767188538837cfe5e7acbab9607e809b5bb85017518cbaeae | jfacorro/clojure-lab | lang.clj | (ns lab.plugin.markdown.lang
"Markdown language specification."
(:require [clojure.zip :as zip]
[lab.core :as lab]
[lab.core [plugin :as plugin]
[lang :as lang]
[keymap :as km]]
[lab.model.protocols :as model]
[lab.ui.core :... | null | https://raw.githubusercontent.com/jfacorro/clojure-lab/f0b5a4b78172984fc876f063f66e5e1592178da9/src/clj/lab/plugin/markdown/lang.clj | clojure |
Code for testing out the grammar | (ns lab.plugin.markdown.lang
"Markdown language specification."
(:require [clojure.zip :as zip]
[lab.core :as lab]
[lab.core [plugin :as plugin]
[lang :as lang]
[keymap :as km]]
[lab.model.protocols :as model]
[lab.ui.core :... |
3c6fd36779abaebaed5d3139d886768b91458790a2f9e0dbda6cf6710690771f | klarna/mnesia_eleveldb | mnesia_eleveldb_tlib.erl | %%----------------------------------------------------------------
Copyright ( c ) 2013 - 2016 Klarna AB
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the License at
%%
%% ... | null | https://raw.githubusercontent.com/klarna/mnesia_eleveldb/1bbeb9243cf0e7f3ef36a713bf657b3ebf31fb63/test/mnesia_eleveldb_tlib.erl | erlang | ----------------------------------------------------------------
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 the
specific language governing permissions an... | Copyright ( c ) 2013 - 2016 Klarna AB
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
-module(mnesia_eleveldb_tlib).
-export(... |
856499c1771c020f21343c91447b73facc1327d114475d03751a361a8fad2e74 | the-little-typer/pie | normalize.rkt | #lang typed/racket
;;; normalize.rkt
;;;
;;; This file implements normalization by evaluation.
(require "basics.rkt")
(require (for-syntax racket/base syntax/parse))
(require/typed "locations.rkt" (location->srcloc (-> Loc Srcloc)))
(provide (all-defined-out))
;;; Call-by-need evaluation
;; Pie is a total languag... | null | https://raw.githubusercontent.com/the-little-typer/pie/a698d4cacd6823b5161221596d34bd17ce5282b8/normalize.rkt | racket | normalize.rkt
This file implements normalization by evaluation.
Call-by-need evaluation
Pie is a total language, which means that every program will
eventually terminate. Because the steps taken during evaluation are
acceptable to choose any order of evaluation.
On the other hand, many useful Pie programs will ... | #lang typed/racket
(require "basics.rkt")
(require (for-syntax racket/base syntax/parse))
(require/typed "locations.rkt" (location->srcloc (-> Loc Srcloc)))
(provide (all-defined-out))
completely deterministic , and because is total , it is
instance , consider zerop from chapter 3 of The Little Typer . zero... |
2b59c77a87c764ad703f49142b4944bc9db7d74939171c33732b4baec082a0fa | valderman/aoc21 | Common.hs | # LANGUAGE FlexibleInstances #
module Common where
import Data.List (group, sort)
class Input a where
readInput :: String -> a
both :: Input a => (a -> String) -> (a -> String) -> IO ()
both part1 part2 = interact $ \str -> let input = readInput str in unlines [part1 input, part2 input]
todo :: Input a => a -> S... | null | https://raw.githubusercontent.com/valderman/aoc21/84528b4358c14087adf080fff000128c81753a18/Common.hs | haskell | | Non-stable O(n log n) version of nub. | # LANGUAGE FlexibleInstances #
module Common where
import Data.List (group, sort)
class Input a where
readInput :: String -> a
both :: Input a => (a -> String) -> (a -> String) -> IO ()
both part1 part2 = interact $ \str -> let input = readInput str in unlines [part1 input, part2 input]
todo :: Input a => a -> S... |
010d48fc260a99bdd2bd61096fa3830d307442f7e65ee1daac8c8c179c142e7d | sharplispers/cxml | recoder.lisp | recoder.lisp -- SAX handler for string conversion
;;;;
This file is part of the CXML parser , released under Lisp - LGPL .
;;;; See file COPYING for details.
;;;;
Developed 2004 for headcraft - /
Copyright :
(cl:in-package #:cxml)
(defclass recoder ()
((recoder :initarg :recoder :accessor recoder)
... | null | https://raw.githubusercontent.com/sharplispers/cxml/8701da08ba4aac30891b8d2005edb018c1d3d796/xml/recoder.lisp | lisp |
See file COPYING for details.
| recoder.lisp -- SAX handler for string conversion
This file is part of the CXML parser , released under Lisp - LGPL .
Developed 2004 for headcraft - /
Copyright :
(cl:in-package #:cxml)
(defclass recoder ()
((recoder :initarg :recoder :accessor recoder)
(chained-handler :initarg :chained-handler :a... |
f17cfbaf6e05d804603d7c4ee45e57de5a8706cff4b4f0af30324656686c68ae | johnlawrenceaspden/hobby-code | pyths.clj | (use 'clojure.contrib.monads)
;;A simple-minded monad comprehension to find pythagorean triples
(defn pyths-sequence-monad-cubic [n]
(domonad sequence-m
[a (range 1 n)
b (range 1 n)
c (range 1 n) :when (=(+ (* a a) (* b b)) (* c c))]
(list a b c)))
(pyths-sequence-monad-cubic 2... | null | https://raw.githubusercontent.com/johnlawrenceaspden/hobby-code/48e2a89d28557994c72299962cd8e3ace6a75b2d/pyths.clj | clojure | A simple-minded monad comprehension to find pythagorean triples
lots of redundancy in there
some triangles are multiples of each other. Let's ignore them too.
That's the answer we're looking for
but it's order n^3. Let's pre-compute the squares, and also notice that there's
no point testing (a b) and (b a) every time.
... | (use 'clojure.contrib.monads)
(defn pyths-sequence-monad-cubic [n]
(domonad sequence-m
[a (range 1 n)
b (range 1 n)
c (range 1 n) :when (=(+ (* a a) (* b b)) (* c c))]
(list a b c)))
(pyths-sequence-monad-cubic 20)
(defn pyths-set-monad-cubic [n]
(domonad set-m
[a... |
09c27c6df7b4ce0cd807f8170f903b52b8a295fdc29fe072681d257e23be3868 | Workiva/eva | tree.clj | Copyright 2015 - 2019 Workiva Inc.
;;
;; Licensed under the Eclipse Public License 1.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -1.0.php
;;
;; Unless required by applicable law or agreed to in writing, software
dist... | null | https://raw.githubusercontent.com/Workiva/eva/b7b8a6a5215cccb507a92aa67e0168dc777ffeac/core/src/eva/v2/datastructures/bbtree/logic/v0/tree.clj | clojure |
Licensed under the Eclipse Public License 1.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-1.0.php
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expre... | Copyright 2015 - 2019 Workiva Inc.
distributed under the License is distributed on an " AS IS " BASIS ,
(ns eva.v2.datastructures.bbtree.logic.v0.tree
(:require [eva.v2.datastructures.bbtree.logic.v0.nodes :as nodes]
[eva.v2.datastructures.bbtree.logic.v0.buffer :as buffer]
[eva.datastruc... |
c1226fcd158827474211c238888916f47874c379463c5b18b72ac21d3fce9e75 | alanz/incremental-play | Repetitive.hs | # OPTIONS_GHC -w #
{-# OPTIONS -XMagicHash -XBangPatterns -XTypeSynonymInstances -XFlexibleInstances -cpp #-}
{-# LANGUAGE OverloadedStrings #-}
module Repetitive where
import Data.Char
import Data.Maybe
import Data.List
import Data.Tree
import qualified Data.Bits as Bits
import Data.Text.Prettyprint.Doc
import Data.T... | null | https://raw.githubusercontent.com/alanz/incremental-play/b7b8df2858adaf8637179f009e4ce30dc9fa4751/generated-parsers/Repetitive.hs | haskell | # OPTIONS -XMagicHash -XBangPatterns -XTypeSynonymInstances -XFlexibleInstances -cpp #
# LANGUAGE OverloadedStrings #
# NOINLINE happyExpListPerState #
[(ActionEntry,0,-3,1,2,[(1,4),(2,3)]),(ActionEntry,1,0,0,1,[(2,3)]),(ActionEntry,2,-8,6,4,[(4,5),(5,6),(6,7),(10,8)]),(ActionEntry,3,0,0,1,[(14,-1)]),(ActionEntry,4,-4... | # OPTIONS_GHC -w #
module Repetitive where
import Data.Char
import Data.Maybe
import Data.List
import Data.Tree
import qualified Data.Bits as Bits
import Data.Text.Prettyprint.Doc
import Data.Text.Prettyprint.Doc.Render.Terminal
import qualified Data.Array as Happy_Data_Array
import qualified Data.Bits as Bits
import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.