_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 |
|---|---|---|---|---|---|---|---|---|
72ce231a791ec0d6f42d7fb1c54c0caaafc4aacda1003658b0e150f29cf6ea19 | astanin/moo | gensort.hs | An example of a genetic sorting algorithm
contributed by < >
contributed by Jøhannes Lippmann <> -}
import Moo.GeneticAlgorithm.Binary
import Control.Arrow (first)
import Control.Monad (when)
import Data.List (intercalate, sortBy)
import Data.Ord (comparing)
Sorting a list ( of Characters ) using a gen... | null | https://raw.githubusercontent.com/astanin/moo/2e77a94a543d21360f7610c1ee0dda52813997c4/examples/gensort.hs | haskell | make gensort.hs
make gensort.hs
list to be sorted
stopconditions (they are very high)
genomes
Dealing with Genomes
the bigger d the more permutations are evaluated, so they are more equaly distributed | An example of a genetic sorting algorithm
contributed by < >
contributed by Jøhannes Lippmann <> -}
import Moo.GeneticAlgorithm.Binary
import Control.Arrow (first)
import Control.Monad (when)
import Data.List (intercalate, sortBy)
import Data.Ord (comparing)
Sorting a list ( of Characters ) using a gen... |
b1cbbc1ae2fd9e5057606b81f900c4cf2b31dd800e1db7269854979393e84e33 | facebook/pyre-check | queryTest.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/378f52ff30041cec9478102d55b627b62cd26196/source/server/test/queryTest.ml | ocaml | TODO: Return some sort of error
TODO(T124426942): We are mistakenly overwriting the type of the iterator
variable (list[int]) with the type of `<variable>.__iter__().__next__()`
(int), because they have the same location.
TODO(T124426942): We are mistakenly overwriting t... |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
4aa1292eb54f662124b4e9fc4fe903bbd31b8d1ffd241e720202faf602c37c90 | archaelus/erms | esvc_voucher_import.erl | %%%-------------------------------------------------------------------
@copyright Catalyst IT Ltd ( )
%%%
@author < >
%% @version {@vsn}, {@date} {@time}
@doc Voucher CVS file import code
%% @end
%%%-------------------------------------------------------------------
-module(esvc_voucher_import).
-include_lib(... | null | https://raw.githubusercontent.com/archaelus/erms/5dbe5e79516a16e461e7a2a345dd80fbf92ef6fa/src/esvc_voucher_import.erl | erlang | -------------------------------------------------------------------
@version {@vsn}, {@date} {@time}
@end
-------------------------------------------------------------------
API
====================================================================
API
================================================================... | @copyright Catalyst IT Ltd ( )
@author < >
@doc Voucher CVS file import code
-module(esvc_voucher_import).
-include_lib("eunit/include/eunit.hrl").
-include_lib("logging.hrl").
-include_lib("mnesia_model.hrl").
-export([read_campaign_file/1,
campaign/3,
parse_line/1]).
read_campaign_... |
c1394f689c69b2cd9e273189b9eda18200f3c314a1cc996aa077608d21223f0f | Lovesan/doors | interface-defs.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
Copyright ( C ) 2010 - 2011 , < >
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
;;; restriction, including without lim... | null | https://raw.githubusercontent.com/Lovesan/doors/12a2fe2fd8d6c42ae314bd6d02a1d2332f12499e/com/interface-defs.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
furnished to do... |
Copyright ( C ) 2010 - 2011 , < >
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
(in-packag... |
404361d4ca4936e508dde28e5b76c7b2e584542c01e65e5c25648c31dab048b0 | alanb2718/wallingford | selecting-live3.rkt | #lang s-exp rosette
Example of selecting objects . There are three circles and we select one .
; The list of potential targets is stored in a variable, rather than being a procedure call.
; This results in *non-linear constraints* which causes z3 to return 'unknown' and crash.
(require "reactive.rkt")
put item... | null | https://raw.githubusercontent.com/alanb2718/wallingford/9dd436c29f737d210c5b87dc1b86b2924c0c5970/reactive/selecting-live3.rkt | racket | The list of potential targets is stored in a variable, rather than being a procedure call.
This results in *non-linear constraints* which causes z3 to return 'unknown' and crash. | #lang s-exp rosette
Example of selecting objects . There are three circles and we select one .
(require "reactive.rkt")
put item as the first element in the list referred to by the box things
(define (put-first item things)
(let* ([things-list (unbox things)]
[others (filter (lambda (x) (not (eq? item... |
529bed018a955312510ee9510b61dc88fac124211bbda7122abe4e57cbd4dda7 | haskell/haskell-language-server | MetaBindOne.hs | foo :: a -> (a, a)
foo a = [wingman| split, assumption |]
| null | https://raw.githubusercontent.com/haskell/haskell-language-server/f3ad27ba1634871b2240b8cd7de9f31b91a2e502/plugins/hls-tactics-plugin/new/test/golden/MetaBindOne.hs | haskell | foo :: a -> (a, a)
foo a = [wingman| split, assumption |]
| |
673754d3cbbd5a07c2faeee0571d0ea3f5fbe52ce98e43e46367afb95c055614 | 8c6794b6/guile-tjit | ir-string.scm | ANF IR for strings , symbols , and keywords
Copyright ( C ) 2015 , 2016 Free Software Foundation , Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 3... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/language/trace/ir-string.scm | scheme |
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See... | ANF IR for strings , symbols , and keywords
Copyright ( C ) 2015 , 2016 Free Software Foundation , Inc.
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , MA
02... |
52187b29e5cd33ca6757867f5937e47ad70670754f3a5a747c77fd86eeb4ce47 | namenu/bootcamp-maze | recursive_backtracker.cljc | (ns maze.seq.recursive-backtracker
(:require [maze.core :refer [full-grid rand-pos all-pos rand-neighbor link-cells]])
(:require-macros [maze.seq.macros :refer [defmaze]]))
(defmaze RecursiveBacktracker [output stack unvisited]
(if-not (empty? unvisited)
(let [cur-pos (peek stack)]
(if-let [new-pos (ra... | null | https://raw.githubusercontent.com/namenu/bootcamp-maze/0558ba6b624bc0b6a5312415972398401396c4cf/src/maze/seq/recursive_backtracker.cljc | clojure | (ns maze.seq.recursive-backtracker
(:require [maze.core :refer [full-grid rand-pos all-pos rand-neighbor link-cells]])
(:require-macros [maze.seq.macros :refer [defmaze]]))
(defmaze RecursiveBacktracker [output stack unvisited]
(if-not (empty? unvisited)
(let [cur-pos (peek stack)]
(if-let [new-pos (ra... | |
1decfdf96b691d0ab8aec6ffe725f1119f3bfc20d13dba1e4f5741d0c6adda54 | vyzo/gerbil | module__1.scm | (declare (block) (standard-bindings) (extended-bindings) (inlining-limit 200))
(begin
(define |gx[1]#_g16045_|
(##structure
gx#syntax-quote::t
'module-import::t
#f
(gx#current-expander-context)
'()))
(define |gx[1]#_g16046_|
(##structure
gx#syntax-quote::t
'make-module-imp... | null | https://raw.githubusercontent.com/vyzo/gerbil/17fbcb95a8302c0de3f88380be1a3eb6fe891b95/src/bootstrap/gerbil/expander/module__1.scm | scheme | <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | (declare (block) (standard-bindings) (extended-bindings) (inlining-limit 200))
(begin
(define |gx[1]#_g16045_|
(##structure
gx#syntax-quote::t
'module-import::t
#f
(gx#current-expander-context)
'()))
(define |gx[1]#_g16046_|
(##structure
gx#syntax-quote::t
'make-module-imp... |
774d12235b10c578c8f01e9c9689bfff9164d116b30039964f35f69a9fccb782 | vyos/vyconf | message.ml | * The wire protocol of VyConf .
Messages are preceded by a length header , four bytes in network order .
Messages are preceded by a length header, four bytes in network order.
*)
let read ic =
let header = Bytes.create 4 in
let%lwt () = Lwt_io.read_into_exactly ic header 0 4 in
let length ... | null | https://raw.githubusercontent.com/vyos/vyconf/dd9271b4304c6b1a5a2576821d1b2b8fd3aa6bf5/src/message.ml | ocaml | * The wire protocol of VyConf .
Messages are preceded by a length header , four bytes in network order .
Messages are preceded by a length header, four bytes in network order.
*)
let read ic =
let header = Bytes.create 4 in
let%lwt () = Lwt_io.read_into_exactly ic header 0 4 in
let length ... | |
9d93f6f42c3713844effe05465b5c8cbb9c07b227d59445a6e555fc60806e211 | ghc/packages-dph | Dump.hs |
module DPH.Pass.Dump
(passDump)
where
import DPH.Core.Pretty
import HscTypes
import CoreMonad
import System.IO.Unsafe
-- | Dump a module.
passDump :: String -> ModGuts -> CoreM ModGuts
passDump name guts
= unsafePerformIO
$ do
writeFile ("dump." ++ name ++ ".hs")
$ render RenderIndent (pprM... | null | https://raw.githubusercontent.com/ghc/packages-dph/64eca669f13f4d216af9024474a3fc73ce101793/dph-plugin/DPH/Pass/Dump.hs | haskell | | Dump a module. |
module DPH.Pass.Dump
(passDump)
where
import DPH.Core.Pretty
import HscTypes
import CoreMonad
import System.IO.Unsafe
passDump :: String -> ModGuts -> CoreM ModGuts
passDump name guts
= unsafePerformIO
$ do
writeFile ("dump." ++ name ++ ".hs")
$ render RenderIndent (pprModGuts guts)
... |
106ffd182909af1b5f6c3cc2b90e4a474b6728cfd81645b2cae4408c6e87b10f | jbrisbin/rabbit_common | rabbit_reader.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/jbrisbin/rabbit_common/80814606ae23cc820c74e443383e192cd69ec030/src/rabbit_reader.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.
Every connecti... | 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 - 2016 Pivotal Software , Inc. All rights reserved .
... |
e3159b37d22911f72d3279b54de827f7bab3354d5ec71d22412790317f46b160 | ropas/sparrow | taintDom.mli | (***********************************************************************)
(* *)
Copyright ( c ) 2007 - present .
Programming Research Laboratory ( ROPAS ) , Seoul National University .
(* All rights reserved... | null | https://raw.githubusercontent.com/ropas/sparrow/3ec055b8c87b5c8340ef3ed6cde34f5835865b31/src/domain/taintDom.mli | ocaml | *********************************************************************
All rights reserved.
See the LICENSE file for details. ... | Copyright ( c ) 2007 - present .
Programming Research Laboratory ( ROPAS ) , Seoul National University .
This software is distributed under the term of the BSD license .
module IntOverflow : sig
type t = Bot | Top
include AbsDom.LAT with type t := t
val is_bot :... |
4047f80ad864a2b2a4018e513cca45e0f3088e679fe5c5766ebe19ac4a12bd15 | reflectionalist/S9fES | list-to-set.scm | Scheme 9 from Empty Space , Function Library
By , 2009
; Placed in the Public Domain
;
; (list->set list) ==> list
;
; (load-from-library "list-to-set.scm")
;
Convert list to set . A set is a list containing unique members .
;
; Example: (list->set '(a b c b c)) ==> (a b c)
(define (list->set a)
(letr... | null | https://raw.githubusercontent.com/reflectionalist/S9fES/0ade11593cf35f112e197026886fc819042058dd/lib/list-to-set.scm | scheme | Placed in the Public Domain
(list->set list) ==> list
(load-from-library "list-to-set.scm")
Example: (list->set '(a b c b c)) ==> (a b c) | Scheme 9 from Empty Space , Function Library
By , 2009
Convert list to set . A set is a list containing unique members .
(define (list->set a)
(letrec
((list->set2
(lambda (a r)
(cond ((null? a)
(reverse! r))
((member (car a) r)
(list->set... |
f972b4109ae4d0eea18dbfc1e4bbc678d35d845da448bbce186b997bb5bd88cb | cartazio/language-c | Data.hs | -----------------------------------------------------------------------------
-- |
Module : Language . C.Data
Copyright : ( c ) 2008
-- License : BSD-style
-- Maintainer :
-- Stability : experimental
Portability : ghc
--
Common data types for Language . C : Identifiers , unique names , s... | null | https://raw.githubusercontent.com/cartazio/language-c/d003206a45baec4e2a2a85026d88bd225162d951/src/Language/C/Data.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style
Maintainer :
Stability : experimental
ast node attributes and extensible errors.
---------------------------------------------------------------------------
* Input stream
* Identifiers
* Source code posi... | Module : Language . C.Data
Copyright : ( c ) 2008
Portability : ghc
Common data types for Language . C : Identifiers , unique names , source code locations ,
module Language.C.Data (
module Language.C.Data.InputStream,
SUERef(..), isAnonymousRef,
Ident,mkIdent, identToString, inter... |
a0d390045d4c337895165cf4e11046405a1483aefa6094f2e3be501ae9b3e721 | dannypsnl/plt-research | change-app.rkt | #lang racket
(provide (except-out (all-from-out racket)
#%app)
(rename-out [@#%app #%app]))
(require syntax/parse/define)
(define-syntax-parser @#%app
[(_ f:expr arg*:expr ...)
(displayln (format "applying ~a" #'f))
#'(#%app f arg* ...)])
| null | https://raw.githubusercontent.com/dannypsnl/plt-research/1776291ce867fad951b563e43d3bde50c7f1ebd3/racket/macro/change-app.rkt | racket | #lang racket
(provide (except-out (all-from-out racket)
#%app)
(rename-out [@#%app #%app]))
(require syntax/parse/define)
(define-syntax-parser @#%app
[(_ f:expr arg*:expr ...)
(displayln (format "applying ~a" #'f))
#'(#%app f arg* ...)])
| |
2469b15905f167b00ac889efde520d62c4a6229cdb62354cbd8e95fc5ecfa89c | haskoin/haskoin-wallet | Parser.hs | {-# LANGUAGE OverloadedStrings #-}
module Network.Haskoin.Wallet.Parser where
import Control.Monad (forM, join, unless, when)
import Control.Monad.Except
import Data.Aeson.TH
import Data.Either (either, rights)
import Data.... | null | https://raw.githubusercontent.com/haskoin/haskoin-wallet/6ec0851d745e41fc011715eae461bf29c3019e9e/src/Network/Haskoin/Wallet/Parser.hs | haskell | # LANGUAGE OverloadedStrings #
Command Parsers | module Network.Haskoin.Wallet.Parser where
import Control.Monad (forM, join, unless, when)
import Control.Monad.Except
import Data.Aeson.TH
import Data.Either (either, rights)
import Data.Foldable (asu... |
8cc022078e3c6b930dddbbd1e076980863611bf5372b6697bcbe470619cd82df | mzp/msgpack-ocaml | base.ml | external (@@) : ('a -> 'b) -> 'a -> 'b = "%apply"
external (+>) : 'a -> ('a -> 'b) -> 'b = "%revapply"
let ($) f g x = f (g x)
let (!$) = Lazy.force
external id : 'a -> 'a = "%identity"
let uncurry f a b = f (a,b)
let curry f (a,b) = f a b
let flip f a b = f b a
let const a _ = a
let sure f =
function
Some x... | null | https://raw.githubusercontent.com/mzp/msgpack-ocaml/acfbfcbcc62a4f69f9fd024e28e42086048a9f16/lib/core/base.ml | ocaml | external (@@) : ('a -> 'b) -> 'a -> 'b = "%apply"
external (+>) : 'a -> ('a -> 'b) -> 'b = "%revapply"
let ($) f g x = f (g x)
let (!$) = Lazy.force
external id : 'a -> 'a = "%identity"
let uncurry f a b = f (a,b)
let curry f (a,b) = f a b
let flip f a b = f b a
let const a _ = a
let sure f =
function
Some x... | |
62a92ed14cb61001aacb5e2941f4812609d640631a0c0f6b250050d51de25e22 | timbertson/opam2nix | digest_cache.ml | module JSON = Yojson.Basic
open Util
module Cache = struct
include Map.Make(String)
end
module StringSet = Set.Make(String)
type key = string
type nix_digest = [
| `sha256 of string
]
type checksum_mismatch = [ `checksum_mismatch of string ]
type unknown_error = [ `error of string ]
type error = [
| checksum_misma... | null | https://raw.githubusercontent.com/timbertson/opam2nix/d66764553c19a86520107977c0105f9d2d520b78/src/digest_cache.ml | ocaml | automatically populated on `fetch` and discarded on save
assume sha256
drop from cache | module JSON = Yojson.Basic
open Util
module Cache = struct
include Map.Make(String)
end
module StringSet = Set.Make(String)
type key = string
type nix_digest = [
| `sha256 of string
]
type checksum_mismatch = [ `checksum_mismatch of string ]
type unknown_error = [ `error of string ]
type error = [
| checksum_misma... |
f7581718756ae2ebe650f2be10868ef049e0aa7a6a1e42fc228602dbf2eeef63 | thoughtbot/carnival | Settings.hs | -- | Settings are centralized, as much as possible, into this file. This
-- includes database connection settings, static file locations, etc.
In addition , you can configure a number of different aspects of Yesod
by overriding methods in the Yesod typeclass . That instance is
declared in the Foundation.hs file .... | null | https://raw.githubusercontent.com/thoughtbot/carnival/1cd4bd02ea6884b86020029257ab69ec3892a168/Settings.hs | haskell | | Settings are centralized, as much as possible, into this file. This
includes database connection settings, static file locations, etc.
| Actions which only require access to the database connection can be given
called in tests.
| Runtime settings to configure this application. These settings can be
loaded fro... | In addition , you can configure a number of different aspects of Yesod
by overriding methods in the Yesod typeclass . That instance is
declared in the Foundation.hs file .
module Settings where
import ClassyPrelude.Yesod
import Control.Exception (throw)
import Data.Aeson (Result (..), ... |
760aa9e1244a296e6493fd422a2a9c8fe0ee394cc5c2d6374159feff0aadca9f | conal/circat | Classes.hs | # LANGUAGE TypeOperators , TypeFamilies , ConstraintKinds , GADTs , CPP #
{-# LANGUAGE ScopedTypeVariables, Rank2Types, MultiParamTypeClasses #-}
# LANGUAGE FlexibleInstances , FlexibleContexts #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wall #
{ - # OPTIONS_GHC -fno - warn - unused - imports # - } -- TEMP
... | null | https://raw.githubusercontent.com/conal/circat/083155b1aafe523fb0df84aaa107064b36c1fd0d/src/Circat/Classes.hs | haskell | # LANGUAGE ScopedTypeVariables, Rank2Types, MultiParamTypeClasses #
TEMP
TEMP
--------------------------------------------------------------------
|
License : BSD3
Maintainer :
Stability : experimental
Additional type classes for circuit-friendly operations
----------------------------------------... | # LANGUAGE TypeOperators , TypeFamilies , ConstraintKinds , GADTs , CPP #
# LANGUAGE FlexibleInstances , FlexibleContexts #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wall #
Module : Circat . Classes
Copyright : ( c ) 2013 Tabula , Inc.
module Circat.Classes where
import Prelude hiding (id,... |
75e3fc0e0f8df94c067577c65dc24b516c82defe2474f39c23fede25625c0fad | ermine/kombain | textile_test.ml | open Textile_lib
let () =
let file = Sys.argv.(1) in
let input = Kmb_input.of_file file in
let result = Textile_parser.parse input in
match result with
| Kmb_lib.Failed ->
Printf.printf "failed"
| Kmb_lib.Parsed (ast, rest) ->
Printf.printf "Parsed\n";
List.iter print_toke... | null | https://raw.githubusercontent.com/ermine/kombain/07f643c892b0b9c2ef08d67428bb9125d5251f82/textile/textile_test.ml | ocaml | open Textile_lib
let () =
let file = Sys.argv.(1) in
let input = Kmb_input.of_file file in
let result = Textile_parser.parse input in
match result with
| Kmb_lib.Failed ->
Printf.printf "failed"
| Kmb_lib.Parsed (ast, rest) ->
Printf.printf "Parsed\n";
List.iter print_toke... | |
70fcf410454c5b785f3daa6593a5a77da729b00675c191893af7f1d47797afba | ocheron/cryptostore | Type.hs | -- |
Module : Crypto . Store . CMS.Type
-- License : BSD-style
Maintainer : < >
-- Stability : experimental
-- Portability : unknown
--
CMS content information type .
# LANGUAGE ExistentialQuantification #
{-# LANGUAGE GADTs #-}
# LANGUAGE TypeFamilies #
module Crypto.Store.CMS.Type
( Content... | null | https://raw.githubusercontent.com/ocheron/cryptostore/a9c5ad06bdc4197663ba933b0a62c3c33cf92a17/src/Crypto/Store/CMS/Type.hs | haskell | |
License : BSD-style
Stability : experimental
Portability : unknown
# LANGUAGE GADTs #
^ Arbitrary octet string
^ Signed content info
^ Enveloped content info
^ Content info with associated digest
^ Encrypted content info
^ Authenticated content info
^ Authenticated-enveloped content info
type is is... | Module : Crypto . Store . CMS.Type
Maintainer : < >
CMS content information type .
# LANGUAGE ExistentialQuantification #
# LANGUAGE TypeFamilies #
module Crypto.Store.CMS.Type
( ContentType(..)
, Encap(..)
, fromEncap
) where
import Data.ASN1.OID
import Crypto.Store.CMS.Util
| CMS... |
00c457b0799ad39c9a3a91fe5c7e9ec7492726a624e2fb7d623ffef0b921648b | pNre/Hera | main.ml | open Async
open Core
open Cohttp_async
let failure_handler _socket exn =
Logging.Main.error "server handler failed with %s" (Exn.to_string exn)
;;
let request_handler ~body _ req =
match req, Request.uri req |> Uri.path with
| { Request.meth = `POST; _ }, path when String.equal path ("/" ^ Telegram.token) ->
... | null | https://raw.githubusercontent.com/pNre/Hera/f3928380eb94a61637f0459818f9cec650ee8220/hera/main.ml | ocaml | open Async
open Core
open Cohttp_async
let failure_handler _socket exn =
Logging.Main.error "server handler failed with %s" (Exn.to_string exn)
;;
let request_handler ~body _ req =
match req, Request.uri req |> Uri.path with
| { Request.meth = `POST; _ }, path when String.equal path ("/" ^ Telegram.token) ->
... | |
5986e8352b2351f560505e08f42cf46eb5eb2d89e254d518f5a248c15687e635 | mbutterick/typesetting | fr.rkt | #lang s-exp "private/bootstrap.rkt"
fr | null | https://raw.githubusercontent.com/mbutterick/typesetting/8eedb97bb64cb2ff0cd9646eb1b0e46b67f1af44/hyphenate/hyphenate/fr.rkt | racket | #lang s-exp "private/bootstrap.rkt"
fr | |
86d61dbd05bdde48398014a5b5acf859a76d3602d3c747088abb5c9db54b4212 | larcenists/larceny | sysexit.scm | (entry _start)
(text
(label _start
(begin
(mov eax 1)
(mov ebx 0)
(int #x80))))
| null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/src/Lib/Sassy/tests/sysexit.scm | scheme | (entry _start)
(text
(label _start
(begin
(mov eax 1)
(mov ebx 0)
(int #x80))))
| |
566fd6cbff85ed389d4275c9eefd2be857878ff6baa304b4731361236360e6da | metaocaml/ber-metaocaml | typedecl.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
and ,... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/typing/typedecl.ml | ocaml | ************************************************************************
OCaml
... | and , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Misc
open Asttypes
open Parsetree
open Primitive
open Types
open Typetexp
module String = Misc.Stdlib.String
ty... |
f26dcc722a6bff97ae0fd1e81b561f73a9496cc92944e57fa13b7ea867660eab | nuvla/api-server | credential_template_api_key.cljc | (ns sixsq.nuvla.server.resources.spec.credential-template-api-key
(:require
[clojure.spec.alpha :as s]
[sixsq.nuvla.server.resources.spec.credential-template :as ps]
[sixsq.nuvla.server.util.spec :as su]
[spec-tools.core :as st]))
(s/def ::ttl
(-> (st/spec nat-int?)
(assoc :name "ttl"
... | null | https://raw.githubusercontent.com/nuvla/api-server/a64a61b227733f1a0a945003edf5abaf5150a15c/code/src/sixsq/nuvla/server/resources/spec/credential_template_api_key.cljc | clojure | Defines the contents of the api-key template used in a create resource. | (ns sixsq.nuvla.server.resources.spec.credential-template-api-key
(:require
[clojure.spec.alpha :as s]
[sixsq.nuvla.server.resources.spec.credential-template :as ps]
[sixsq.nuvla.server.util.spec :as su]
[spec-tools.core :as st]))
(s/def ::ttl
(-> (st/spec nat-int?)
(assoc :name "ttl"
... |
d9241d70a3eab1853f5651127c34a48817a62eb130e83ebe0b654c40efaa39f1 | coco-team/lustrec | model_simple.ml | open Datatype
open Basetypes
open SF
let name = "simple"
let condition x = condition {
expr = Corelang.mkexpr Location.dummy_loc (Lustre_types.Expr_const (Corelang.const_of_bool true));
cinputs = [];
coutputs = [];
cvariables = [];
}
let action _ = no_action
let model : prog_t =
let state_main = "ma... | null | https://raw.githubusercontent.com/coco-team/lustrec/b21f9820df97e661633cd4418fdab68a6c6ca67d/src/tools/stateflow/models/model_simple.ml | ocaml | open Datatype
open Basetypes
open SF
let name = "simple"
let condition x = condition {
expr = Corelang.mkexpr Location.dummy_loc (Lustre_types.Expr_const (Corelang.const_of_bool true));
cinputs = [];
coutputs = [];
cvariables = [];
}
let action _ = no_action
let model : prog_t =
let state_main = "ma... | |
dfa38c87d466a75acffafb2a49188c28baa65413caf5ae5cc1674899a857ee14 | fyquah/hardcaml_zprize | bram.mli | * Double buffered ( Ultra)ram blocks which provide 2 read and 2 write ports .
Internally we instantiate 2 seperate rams to provide the require port
density . The write ports access one ram , while the read ports access the
other . The [ flip ] signal swaps which rams are read and written .
Internall... | null | https://raw.githubusercontent.com/fyquah/hardcaml_zprize/553b1be10ae9b977decbca850df6ee2d0595e7ff/libs/hardcaml_ntt/src/bram.mli | ocaml | * Choose between implementation for simulation or synthesis
* Depth of RAM
* Swap which ram is accessed for reading and writing. | * Double buffered ( Ultra)ram blocks which provide 2 read and 2 write ports .
Internally we instantiate 2 seperate rams to provide the require port
density . The write ports access one ram , while the read ports access the
other . The [ flip ] signal swaps which rams are read and written .
Internall... |
5a954df6672b80f1378fbda0fe3058a4b87ce407b97afa79abc0a6e326c4c18a | vouch-opensource/vouch-load-tests | register_user.clj | (ns com.example.task.register-user
(:require
[cheshire.core :as json]
[clj-http.client :as http]
[clojure.core.async :refer [<! chan close! go put!]]
[clojure.tools.logging :as log]
[io.vouch.load-tests.executor :as executor]))
(defn- register-user
[api-url email password]
(let [chan (chan)]
... | null | https://raw.githubusercontent.com/vouch-opensource/vouch-load-tests/ca0f81097e0b1952f34e1bc7902de4123306c175/dev/com/example/task/register_user.clj | clojure | (ns com.example.task.register-user
(:require
[cheshire.core :as json]
[clj-http.client :as http]
[clojure.core.async :refer [<! chan close! go put!]]
[clojure.tools.logging :as log]
[io.vouch.load-tests.executor :as executor]))
(defn- register-user
[api-url email password]
(let [chan (chan)]
... | |
5589e7ac67929b65983a423c202b170f6915eb7f859d27a372764cddb7a24427 | jaked/orpc | orpc_js_comet_server.ml |
* This file is part of orpc , OCaml signature to ONC RPC generator
* Copyright ( C ) 2008 - 9 Skydeck , Inc
* Copyright ( C ) 2010
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free So... | null | https://raw.githubusercontent.com/jaked/orpc/ecb5df8ec928070cd89cf035167fcedf3623ee3c/src/orpc-js-comet-server/orpc_js_comet_server.ml | ocaml | XXX expire sessions
XXX
return session_id
XXX to potentially save a poll request, defer replies until here
XXX and/or param to wait a bit before reply? |
* This file is part of orpc , OCaml signature to ONC RPC generator
* Copyright ( C ) 2008 - 9 Skydeck , Inc
* Copyright ( C ) 2010
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free So... |
972c7620e37ed75aaf2d4249ea80023dfee5e614266d98c20f710c5cde2ef00f | ferdinand-beyer/refx | interop.clj | (ns refx.interop
(:require [clojure.tools.logging :as log])
(:import [java.util.concurrent Executor Executors]))
(defonce ^:private executor (Executors/newSingleThreadExecutor))
(defn next-tick [f]
(let [bound-f (bound-fn [& args] (apply f args))]
(.execute ^Executor executor bound-f))
nil)
(def empty-qu... | null | https://raw.githubusercontent.com/ferdinand-beyer/refx/27651b5d650a9651d191326ecdb4bcb0e42e3230/core/src/refx/interop.clj | clojure | (ns refx.interop
(:require [clojure.tools.logging :as log])
(:import [java.util.concurrent Executor Executors]))
(defonce ^:private executor (Executors/newSingleThreadExecutor))
(defn next-tick [f]
(let [bound-f (bound-fn [& args] (apply f args))]
(.execute ^Executor executor bound-f))
nil)
(def empty-qu... | |
0ba882639e33836f232732296c4f592522e5234ba3f3d85e0165b678cc611554 | dfinity/motoko | customModuleEncode.mli | val encode : CustomModule.extended_module -> string * string
val promise_reference_slot : int Lib.Promise.t -> int
val allocate_reference_slot : unit -> int
| null | https://raw.githubusercontent.com/dfinity/motoko/399b8e8b0b47890388cd38ee0ace7638d9092b1a/src/wasm-exts/customModuleEncode.mli | ocaml | val encode : CustomModule.extended_module -> string * string
val promise_reference_slot : int Lib.Promise.t -> int
val allocate_reference_slot : unit -> int
| |
e15e269289b8724ed940856de791fc6209b9459fe6e3ef7a229ebc3b044164c1 | tmattio/tyxml-components | alert.ml | open Incr_dom.Tyxml.Html
open Tyxml_components.Vdom
let view =
Tyxml_stories.Component.make
~title:"Simple alerts"
~code:
{|
Tyxml_components.alert (`error "An error occured while processing your request.")
Tyxml_components.alert (`success "Your email has been updated successfully.")
Tyxml_components... | null | https://raw.githubusercontent.com/tmattio/tyxml-components/57603f51ba81bb786a8364eaf9957d65743fd591/lib/tyxml_components/stories/alert.ml | ocaml | open Incr_dom.Tyxml.Html
open Tyxml_components.Vdom
let view =
Tyxml_stories.Component.make
~title:"Simple alerts"
~code:
{|
Tyxml_components.alert (`error "An error occured while processing your request.")
Tyxml_components.alert (`success "Your email has been updated successfully.")
Tyxml_components... | |
85679821641cae4b5241107aef39817d86366b73bcfe1187181287e22f546e6c | egonSchiele/salty | Spec.hs | # LANGUAGE QuasiQuotes #
import Test.HUnit
import qualified PhpSpec
import qualified JsSpec
import qualified LongExamples.Js.SimpleWebPage.Controller
import qualified LongExamples.Js.SimpleWebPage.Nav
allTests = TestList $
PhpSpec.phpTests
++ JsSpec.jsTests
++ LongExamples.... | null | https://raw.githubusercontent.com/egonSchiele/salty/7cb31f35ef0c9d63777d7499174884d7a4054dbb/test/Spec.hs | haskell | # LANGUAGE QuasiQuotes #
import Test.HUnit
import qualified PhpSpec
import qualified JsSpec
import qualified LongExamples.Js.SimpleWebPage.Controller
import qualified LongExamples.Js.SimpleWebPage.Nav
allTests = TestList $
PhpSpec.phpTests
++ JsSpec.jsTests
++ LongExamples.... | |
6e524fc1a983587fbe945399c22b38b44f23cd8abc3ce8ab37edbc70d5a6c8de | camllight/camllight | loadall.ml | load "docteur.ml";;
#open "docteur";;
print_string "Pour lancer: camélia();;"; print_newline();;
| null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/examples/docteur/loadall.ml | ocaml | load "docteur.ml";;
#open "docteur";;
print_string "Pour lancer: camélia();;"; print_newline();;
| |
4e9098726821862453f29391086945d30215a511a8541f82a7640b9c05350eef | input-output-hk/io-sim | Main.hs | module Main (main) where
import Test.Tasty
import qualified Test.MonadTimer
main :: IO ()
main = defaultMain tests
tests :: TestTree
tests =
testGroup "io-classes"
[ Test.MonadTimer.tests
]
| null | https://raw.githubusercontent.com/input-output-hk/io-sim/15a46359d92c2f6a63fcf4671bf5ef4be0c75c35/io-classes/test/Main.hs | haskell | module Main (main) where
import Test.Tasty
import qualified Test.MonadTimer
main :: IO ()
main = defaultMain tests
tests :: TestTree
tests =
testGroup "io-classes"
[ Test.MonadTimer.tests
]
| |
3b1ddde06b1b8601b4bd96295d87e89a754f0d73cfe3af8e89ea62e4c4dc4160 | mindreframer/clojure-stuff | core.clj | (ns puppetlabs.trapperkeeper.core
(:require [clojure.tools.logging :as log]
[slingshot.slingshot :refer [try+ throw+]]
[puppetlabs.kitchensink.core :refer [without-ns]]
[puppetlabs.trapperkeeper.services :as services]
[puppetlabs.trapperkeeper.app :as app]
[... | null | https://raw.githubusercontent.com/mindreframer/clojure-stuff/1e761b2dacbbfbeec6f20530f136767e788e0fe3/github.com/puppetlabs/trapperkeeper/src/puppetlabs/trapperkeeper/core.clj | clojure | it circumvents
it circumvents
dependency resolution between the services will
There is a strict order of operations that need to happen here:
launch your application. This allows you to get a reference to the
This line populates the `main-app` variable with the TrapperkeeperApp | (ns puppetlabs.trapperkeeper.core
(:require [clojure.tools.logging :as log]
[slingshot.slingshot :refer [try+ throw+]]
[puppetlabs.kitchensink.core :refer [without-ns]]
[puppetlabs.trapperkeeper.services :as services]
[puppetlabs.trapperkeeper.app :as app]
[... |
32c8562063ecb9d927928fb696f1155b95008fad992ce5ac019c53d8df0ec345 | myuon/minilight | SpecPushBack.hs | module Data.Vector.Mutable.SpecPushBack where
import Control.Monad
import qualified Data.Vector as V
import qualified Data.Vector.Mutable.PushBack as VMP
import Test.Tasty.Hspec hiding (Failure, Success)
spec_pushback :: Spec
spec_pushback = do
describe "IOVector" $ do
it "can write and read" $ do
let mes... | null | https://raw.githubusercontent.com/myuon/minilight/3c6a4f6b9ed15c97c7de02a281c31152442fb4d7/test/Data/Vector/Mutable/SpecPushBack.hs | haskell | module Data.Vector.Mutable.SpecPushBack where
import Control.Monad
import qualified Data.Vector as V
import qualified Data.Vector.Mutable.PushBack as VMP
import Test.Tasty.Hspec hiding (Failure, Success)
spec_pushback :: Spec
spec_pushback = do
describe "IOVector" $ do
it "can write and read" $ do
let mes... | |
672606aabbd9736b155773137b39c04b18fe0956dc75d017a15deda8d75b3fac | nick8325/quickspec | PartialApplication.hs | -- Pruning support for partial application and the like.
{-# OPTIONS_HADDOCK hide #-}
# LANGUAGE FlexibleInstances , TypeSynonymInstances , RecordWildCards , MultiParamTypeClasses , FlexibleContexts , GeneralizedNewtypeDeriving , UndecidableInstances , DeriveFunctor #
module QuickSpec.Internal.Pruning.PartialApplicatio... | null | https://raw.githubusercontent.com/nick8325/quickspec/134864a6d04dbf100bcb0e8611254c68e6828ad5/src/QuickSpec/Internal/Pruning/PartialApplication.hs | haskell | Pruning support for partial application and the like.
# OPTIONS_HADDOCK hide #
A partially-applied function symbol.
The Int describes how many arguments the function expects.
The ($) operator, for oversaturated applications. | # LANGUAGE FlexibleInstances , TypeSynonymInstances , RecordWildCards , MultiParamTypeClasses , FlexibleContexts , GeneralizedNewtypeDeriving , UndecidableInstances , DeriveFunctor #
module QuickSpec.Internal.Pruning.PartialApplication where
import QuickSpec.Internal.Term
import QuickSpec.Internal.Type
import QuickSpe... |
af3f52e9d103ba39a4940fcb538dccd1c0d463b2b847691408162f8843e51865 | jumarko/clojure-experiments | destructuring.clj | (ns clojure-experiments.destructuring
"Playing with Clojure destructuring.
")
;;; interesting behavior of when-let when using destructuring
;;; there's just no way to use `when-let`/`if-let` on destructured values
(def foo {:a 1})
(when-let [a (:a foo)] (println a))
;; => prints "1", returns nil
(when-let [{... | null | https://raw.githubusercontent.com/jumarko/clojure-experiments/6dc84abe392862854a42ff860807557efa6d2c8e/src/clojure_experiments/destructuring.clj | clojure | interesting behavior of when-let when using destructuring
there's just no way to use `when-let`/`if-let` on destructured values
=> prints "1", returns nil
=> prints "1", returns nil
=> returns nil
=> prints "nil", returns nil
wrong! because default value of timeout-ms is not conveyed in opts.
docstring. but it ... | (ns clojure-experiments.destructuring
"Playing with Clojure destructuring.
")
(def foo {:a 1})
(when-let [a (:a foo)] (println a))
(when-let [{:keys [a]} foo] (println a))
(when-let [a (:a (assoc foo :a nil))] (println a))
(when-let [{:keys [a]} (assoc foo :a nil)] (println a))
(defn private-fun
[opts... |
2076a967e61fc08e88af3a9a11f38e6970eb0a90a7ca8aed8f50b6f824b9d5c4 | plewto/Cadejo | genpatch.clj | (println "--> combo genpatch")
(ns cadejo.instruments.combo.genpatch
(:use [cadejo.instruments.combo.constants])
(:require [cadejo.util.math :as math])
(:require [cadejo.instruments.combo.program :as program]))
(def ^:private filter-types [bypass-filter bypass-filter bypass-filter bypass-filter
... | null | https://raw.githubusercontent.com/plewto/Cadejo/2a98610ce1f5fe01dce5f28d986a38c86677fd67/src/cadejo/instruments/combo/genpatch.clj | clojure | (println "--> combo genpatch")
(ns cadejo.instruments.combo.genpatch
(:use [cadejo.instruments.combo.constants])
(:require [cadejo.util.math :as math])
(:require [cadejo.instruments.combo.program :as program]))
(def ^:private filter-types [bypass-filter bypass-filter bypass-filter bypass-filter
... | |
2cbc9b338c9aa60acc1beb2a910022ca725b697ddd204c3a00e4b74b2cac428f | janestreet/core | queue.ml | open! Import
include Base.Queue
include Test_binary_searchable.Make1_and_test (struct
type nonrec 'a t = 'a t
let get = get
let length = length
module For_test = struct
let of_array a =
let r = create () in
(* We enqueue everything twice, and dequeue it once to ensure:
... | null | https://raw.githubusercontent.com/janestreet/core/4b6635d206f7adcfac8324820d246299d6f572fe/core/src/queue.ml | ocaml | We enqueue everything twice, and dequeue it once to ensure:
- that the queue has the same content as the array.
- that it has, in most cases, an interesting internal structure
Serialization_v1 defines a stable serialization
We don't have a [%bin_digest] expect test here because the bin_io is m... | open! Import
include Base.Queue
include Test_binary_searchable.Make1_and_test (struct
type nonrec 'a t = 'a t
let get = get
let length = length
module For_test = struct
let of_array a =
let r = create () in
for i = 0 to Array.length a - 1 do
enqueue r a.(i)
don... |
602e24258888bc7746137ca2a89435b270b6b1a6c3b5dbc8d83f1196db81334f | K2InformaticsGmbH/imem | imem_if_mnesia_ct.erl | %%%-------------------------------------------------------------------
%%% File : imem_if_mnesia_ct.erl
Description : Common testing imem_if_mnesia .
%%%
%%% Created : 09.12.2017
%%%
Copyright ( C ) 2017 K2 Informatics GmbH
%%%-------------------------------------------------------------------
-module(i... | null | https://raw.githubusercontent.com/K2InformaticsGmbH/imem/602b6cd31ea1af00041a9318119ab0c3e4d5b59a/test/imem_if_mnesia_ct.erl | erlang | -------------------------------------------------------------------
File : imem_if_mnesia_ct.erl
Created : 09.12.2017
-------------------------------------------------------------------
--------------------------------------------------------------------
Test case related setup and teardown functions.
-... | Description : Common testing imem_if_mnesia .
Copyright ( C ) 2017 K2 Informatics GmbH
-module(imem_if_mnesia_ct).
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
-export([
end_per_testcase/2,
table_operations/1
]).
-define(NODEBUG, true).
-include_lib("imem.hrl").
... |
08666b22337b5acf758452e68c12f62861492476af039af8907709fef449fdf2 | FMNSSun/Burlesque | cgi.hs | # LANGUAGE FlexibleContexts #
import Network.CGI
import Text.XHtml.Strict
import Burlesque.Parser
import Burlesque.Types
import Burlesque.Eval
import Burlesque.Display
import qualified Data.Map as M
main = runCGI $ handleErrors cgiMain
linkCSS
= thelink ! [rel "stylesheet", thetype "text/css", href "./style.css"]... | null | https://raw.githubusercontent.com/FMNSSun/Burlesque/1753bdf0186027f3920ab2bd95098f76afef3154/cgi.hs | haskell | # LANGUAGE FlexibleContexts #
import Network.CGI
import Text.XHtml.Strict
import Burlesque.Parser
import Burlesque.Types
import Burlesque.Eval
import Burlesque.Display
import qualified Data.Map as M
main = runCGI $ handleErrors cgiMain
linkCSS
= thelink ! [rel "stylesheet", thetype "text/css", href "./style.css"]... | |
143a714dfe80bb8fd1f8885b606685c8a93ddeebc7cc6d7dc3ade7f63528ac03 | takikawa/racket-ppa | run.rkt | #lang racket/base
(require "xref.rkt"
"render.rkt"
racket/cmdline
raco/command-name
(prefix-in text: "text-render.rkt")
(prefix-in markdown: "markdown-render.rkt")
(prefix-in html: "html-render.rkt")
(prefix-in latex: "latex-render.rkt")
... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/5f2031309f6359c61a8dfd1fec0b77bbf9fb78df/share/pkgs/scribble-lib/scribble/run.rkt | racket | reverse order | #lang racket/base
(require "xref.rkt"
"render.rkt"
racket/cmdline
raco/command-name
(prefix-in text: "text-render.rkt")
(prefix-in markdown: "markdown-render.rkt")
(prefix-in html: "html-render.rkt")
(prefix-in latex: "latex-render.rkt")
... |
b14e0b2dfc51411bbf7e33bf7b46e22a726cfbb2b977b36778e5d56bdc693afb | amuletml/amulet | Kinds.hs | # LANGUAGE ConstraintKinds , FlexibleContexts , LambdaCase , TypeFamilies , ViewPatterns , TupleSections #
module Types.Kinds
( resolveKind
, resolveTyDeclKind, resolveClassKind, resolveTySymDeclKind, resolveTyFunDeclKind
, annotateKind
, closeOver, closeOver'
, checkAgainstKind, getKind, liftType
, general... | null | https://raw.githubusercontent.com/amuletml/amulet/fcba0b7e198b8d354e95722bbe118bccc8483f4e/src/Types/Kinds.hs | haskell | # SOURCE #
_ <- isType ek
Just (string "mentions constraints") | # LANGUAGE ConstraintKinds , FlexibleContexts , LambdaCase , TypeFamilies , ViewPatterns , TupleSections #
module Types.Kinds
( resolveKind
, resolveTyDeclKind, resolveClassKind, resolveTySymDeclKind, resolveTyFunDeclKind
, annotateKind
, closeOver, closeOver'
, checkAgainstKind, getKind, liftType
, general... |
424aa1975b831445b27208d607d59fd00794e6d61d678a0432333be9cf9b146a | 2600hz-archive/whistle | rabbit_msg_store.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/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/lib/rabbitmq_server-2.4.1/src/rabbit_msg_store.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.
internal
upgra... | 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 VMware , Inc.
Copyright ( c ) 2007 - 2011 VMware , Inc. All rights reserved .
-module(rabbi... |
f1fab86c2496e6747be36c9c7bab06cc2c9863c39f02e93eaf4e7c7a776c19e9 | aharisu/Gauche-CV | dist-transform.scm | (use cv)
(let* ([src (cv-load-image "data/image/lenna.png" CV_LOAD_IMAGE_GRAYSCALE)]
[dst (make-image (ref src 'width) (ref src 'height) IPL_DEPTH_32F 1)]
[dst-norm (make-image (ref src 'width) (ref src 'height) IPL_DEPTH_8U 1)])
(cv-dist-transform src dst CV_DIST_L2 3)
(cv-normalize dst dst-norm 0 2... | null | https://raw.githubusercontent.com/aharisu/Gauche-CV/5e4c51501431c72270765121ea4d92693f11d60b/sample/dist-transform.scm | scheme | (use cv)
(let* ([src (cv-load-image "data/image/lenna.png" CV_LOAD_IMAGE_GRAYSCALE)]
[dst (make-image (ref src 'width) (ref src 'height) IPL_DEPTH_32F 1)]
[dst-norm (make-image (ref src 'width) (ref src 'height) IPL_DEPTH_8U 1)])
(cv-dist-transform src dst CV_DIST_L2 3)
(cv-normalize dst dst-norm 0 2... | |
366bf779c9354e96ec3286b667ad4e96f39faa59c34f3ad46eb11dc7d8dc6511 | def-/ghc-vis | nonghci-test.hs | import GHC.Vis
main = do
putStrLn "Start"
let a = "teeest"
let b = [1..3]
let c = b ++ b
let d = [1..]
putStrLn $ show $ d !! 1
vis
view a "a"
view b "b"
view c "c"
view d "d"
getChar
switch
getChar
putStrLn "End"
| null | https://raw.githubusercontent.com/def-/ghc-vis/7b93f3aa80c8e5dad356f62babec861a67e20948/nonghci-test.hs | haskell | import GHC.Vis
main = do
putStrLn "Start"
let a = "teeest"
let b = [1..3]
let c = b ++ b
let d = [1..]
putStrLn $ show $ d !! 1
vis
view a "a"
view b "b"
view c "c"
view d "d"
getChar
switch
getChar
putStrLn "End"
| |
394f3974b16eac6a309a5961e20efa21fd943f66cc41767ea59e385b7fc063a4 | hellonico/origami-dnn | v4.clj | (ns origami-dnn.demo.yolo.v4
(:require
[origami-dnn.net.yolo :as yolo]
[origami-dnn.draw :as d]
[opencv4.core :refer [min-max-loc new-size new-scalar imread imwrite]]
[opencv4.dnn.core :as origami-dnn]))
(defn run-yolo [& args]
(let [input (or (first args) "resources/catwalk.jpg")
[ net _ labels ] ( ... | null | https://raw.githubusercontent.com/hellonico/origami-dnn/f55a32d0d3d528fcf57aaac10cfb20c7998b380c/src/origami_dnn/demo/yolo/v4.clj | clojure | (ns origami-dnn.demo.yolo.v4
(:require
[origami-dnn.net.yolo :as yolo]
[origami-dnn.draw :as d]
[opencv4.core :refer [min-max-loc new-size new-scalar imread imwrite]]
[opencv4.dnn.core :as origami-dnn]))
(defn run-yolo [& args]
(let [input (or (first args) "resources/catwalk.jpg")
[ net _ labels ] ( ... | |
43afb9bf674a8e712514d719f51ea52af440c5caa0db995ede849a8dc7ebd3c5 | charlieg/Sparser | stranded-VP.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
copyright ( c ) 1993,1994,1995 -- all rights reserved
;;;
;;; File: "stranded VP"
;;; Module: "grammar;rules:CA:"
Version : 0.1 April 1995
initiated 7/16/93 v2.3 , fleshed out the edge building 8/4
0.1 ( 4/26/95 ) added case for ' subj... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/grammar/rules/CA/stranded-VP.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
File: "stranded VP"
Module: "grammar;rules:CA:"
reacts to the form-category on a stranded edge
common dispatch point for trying to connect up VPs that are
stranded after their portion of the forest level has gone
subject search across appositives. ... | copyright ( c ) 1993,1994,1995 -- all rights reserved
Version : 0.1 April 1995
initiated 7/16/93 v2.3 , fleshed out the edge building 8/4
0.1 ( 4/26/95 ) added case for ' subj , vp '
(in-package :sparser)
(set-ca-action category::VP 'VP-Ca-dispatch)
(defun vP-CA-dispatch (vp-edge)
quiescent ... |
91bae9a24641d326e159758650be5a7a4bfdb6b57ac0d2f8e48beacfa95e1d54 | alekcz/pcp | included.clj | (ns included)
(def tester 100)
(defn working? []
(every? even? '(2 4 6))) | null | https://raw.githubusercontent.com/alekcz/pcp/72e1821972d62be345174c62635687dd7346a399/test-resources/included.clj | clojure | (ns included)
(def tester 100)
(defn working? []
(every? even? '(2 4 6))) | |
9529d8fddc06ce488d3ce26ba9f6451794d22f4922b4b6e5d451ab498df0d628 | MLstate/opalang | qmlCpsServerLib.ml |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/compiler/qmlcps/qmlCpsServerLib.ml | ocaml | it is an opa tuple
* options for this continuation. Often, the options are shared between several continuation,
using syntax {[let c = { previous_c with payload = new_payload }]}
* Has a behaviour similar to thread_context, but is reserved for use by
database and transaction handling mechanisms
... |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... |
665a20303d09137e793e0f174a91cb2c1cfcf376e1f754c1e897973cfaa1d63b | alexandergunnarson/quantum | websocket.cljc | (ns quantum.net.websocket
(:refer-clojure :exclude [promise])
(:require [com.stuartsierra.component :as component]
[taoensso.sente :as ws ]
#?@(:clj [[immutant.web :as imm ]
[taoensso.sente.server-adapters.immutant... | null | https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/src/quantum/net/websocket.cljc | clojure | Dispatch on event-id
Wrap for logging, catching, etc.:
===== DEFAULT HANDLERS ===== ;
Do nothing
===== `PUT!` ===== ;
to ensure no auto-close
assume it's an event ID
technically, valid hostname
technically, valid port
:http-kit a-http-kit/sente-web-server-adapter
TODO defnt |reset!| | (ns quantum.net.websocket
(:refer-clojure :exclude [promise])
(:require [com.stuartsierra.component :as component]
[taoensso.sente :as ws ]
#?@(:clj [[immutant.web :as imm ]
[taoensso.sente.server-adapters.immutant... |
3cc9dfb81a36b5cfc44e0a6f90bdbd3306470aeba898024e3329c5bd0675b714 | lsrcz/mini-prover | TypingSpec.hs | module MiniProver.Core.TypingSpec (main, spec) where
import MiniProver.Core.Typing
import MiniProver.Core.Syntax
import MiniProver.Core.Context
import MiniProver.Utils.ContextForTesting
import Test.Hspec
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "checkCommandType" $ do
it "Axiom False" $
... | null | https://raw.githubusercontent.com/lsrcz/mini-prover/0aa4cdf3b495ddf6707f27dcbee810d519b43177/test/MiniProver/Core/TypingSpec.hs | haskell | Definition cons2 (T:Type) (a:T) (b:T) (ls:list T) : list T := cons T a (cons T b ls).
fix plus ( x : ) ( y : nat):nat:=
match x in return with
| O = > y
| S xx = > plus xx ( S y )
end
fix plus (x:nat) (y:nat):nat:=
match x in nat return nat with
| O => y
| S xx => plus xx (S y)
e... | module MiniProver.Core.TypingSpec (main, spec) where
import MiniProver.Core.Typing
import MiniProver.Core.Syntax
import MiniProver.Core.Context
import MiniProver.Utils.ContextForTesting
import Test.Hspec
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "checkCommandType" $ do
it "Axiom False" $
... |
9f1d667d4a1c790efd7118038edda21136f8aad97024f4a57c605d86f4c47cfd | ocamllabs/ocaml-modular-implicits | t110-asrint-1.ml | open Lib;;
if (-2 asr 1) <> -1 then raise Not_found;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 -1
11 PUSHCONST1
12 PUSHCONSTINT -2
14 ASRINT
15 NEQ
16 BRANCHIFNOT 23
18 GETGLOBAL Not_found
20 M... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/tool-ocaml/t110-asrint-1.ml | ocaml | open Lib;;
if (-2 asr 1) <> -1 then raise Not_found;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 -1
11 PUSHCONST1
12 PUSHCONSTINT -2
14 ASRINT
15 NEQ
16 BRANCHIFNOT 23
18 GETGLOBAL Not_found
20 M... | |
8888346cfe901ccee5a3c17038c4ac9f4cce5fef3a34618871d56830fa2c1739 | tarides/dune-release | alcotest_ext.ml | open Alcotest
let path = testable Fpath.pp Fpath.equal
let error_msg =
testable Bos_setup.R.pp_msg (fun (`Msg e1) (`Msg e2) -> String.equal e1 e2)
let result_msg testable = result testable error_msg
module Tag = Dune_release.Vcs.Tag
let tag = Alcotest.testable Tag.pp Tag.equal
module Version = Dune_release.Vers... | null | https://raw.githubusercontent.com/tarides/dune-release/6bfed0f299b82c0931c78d4e216fd0efedff0673/tests/lib/alcotest_ext.ml | ocaml | open Alcotest
let path = testable Fpath.pp Fpath.equal
let error_msg =
testable Bos_setup.R.pp_msg (fun (`Msg e1) (`Msg e2) -> String.equal e1 e2)
let result_msg testable = result testable error_msg
module Tag = Dune_release.Vcs.Tag
let tag = Alcotest.testable Tag.pp Tag.equal
module Version = Dune_release.Vers... | |
fed52c5b64dc71d6540b3cc0552820c08bfc3fd4b778f0223e116de332c50b01 | ocamllabs/ocaml-modular-implicits | t020.ml | let _ = () in ();;
*
0 CONST0
1 PUSHCONST0
2 POP 1
4 ATOM0
5 SETGLOBAL T020
7 STOP
*
0 CONST0
1 PUSHCONST0
2 POP 1
4 ATOM0
5 SETGLOBAL T020
7 STOP
**)
| null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/tool-ocaml/t020.ml | ocaml | let _ = () in ();;
*
0 CONST0
1 PUSHCONST0
2 POP 1
4 ATOM0
5 SETGLOBAL T020
7 STOP
*
0 CONST0
1 PUSHCONST0
2 POP 1
4 ATOM0
5 SETGLOBAL T020
7 STOP
**)
| |
4a7c84f06cf7ed4abd927bd1017aa9f93929ed161f569a8c5a3fb973dbacce97 | ssrihari/kosha | app.clj | (ns kosha.app
(:require [ring.adapter.jetty :as jetty]
[ring.middleware.params :as params]
[ring.middleware.keyword-params :as kw-params]
[cider.nrepl :as cider]
[clojure.tools.nrepl.server :as nrepl]
[cheshire.core :as json]
[bidi.ring :as br]
... | null | https://raw.githubusercontent.com/ssrihari/kosha/1d7a1858ec6578b146dca4b842020f9a093d479d/src/kosha/app.clj | clojure | (if (accepts-json? request)
(json-response r/melakarthas)
(html-response
(-> (p/melakartha-rows)
p/html-rows
p/make-html))))
(if (accepts-json? request)
(json-response r/ragams)
(html-response
(p/make-html (p/html-rows)))))
(let [ragam-name (keyword (:name pa... | (ns kosha.app
(:require [ring.adapter.jetty :as jetty]
[ring.middleware.params :as params]
[ring.middleware.keyword-params :as kw-params]
[cider.nrepl :as cider]
[clojure.tools.nrepl.server :as nrepl]
[cheshire.core :as json]
[bidi.ring :as br]
... |
83f3e778821c7cf4a228fea35e519ba5efb1dfcc56c222c6ebad61deca0b3667 | kuberlog/daemon-clj | core.clj | (ns daemon.brochas-area.core
(:require [daemon.face.core :as face]
[daemon.voice.core :as voice]
[org.httpkit.client :as http]
[clojure.data.json :as json]
[clojure.core.async :as async]
[clojure.java.io :as io]
[clojure.java.shell :as shell]))
... | null | https://raw.githubusercontent.com/kuberlog/daemon-clj/904699d005ea2df3d86426d8aa1d3b030178e683/src/daemon/brochas_area/core.clj | clojure | The function that will be dynamically generated to stop a recording session manually
Access-token is a map with :access-token and :expiration-time
Get the initial access token
Automatic, timed based recording stoppage
Manual, hotkey based recording stoppage
also, dynamically set the function called stop-listening | (ns daemon.brochas-area.core
(:require [daemon.face.core :as face]
[daemon.voice.core :as voice]
[org.httpkit.client :as http]
[clojure.data.json :as json]
[clojure.core.async :as async]
[clojure.java.io :as io]
[clojure.java.shell :as shell]))
... |
36e7816a28cc635151789c9a981191a46cc775de7700383e24ed0579399ce0b6 | scicloj/clj-djl | ndarray_creation_test.clj | (ns clj-djl.ndarray.ndarray-creation-test
(:require [clojure.test :refer [deftest testing is]]
[clj-djl.ndarray :as nd]
[clj-djl.engine :as engine])
(:import [ai.djl.ndarray.types DataType]
[java.nio FloatBuffer]))
(deftest size-test
(let [ndm (nd/new-base-manager)]
(is (=... | null | https://raw.githubusercontent.com/scicloj/clj-djl/d735c5885ca82a4b69cc51d6a4a8897ca9f804f1/test/clj_djl/ndarray/ndarray_creation_test.clj | clojure | test scalar
test 2d
test boolean
test 2d
test boolean
generalized
multi dim
scalar
multi-dim
scalar
multi-dim
scalar
multi-dim
scalar
corner case | (ns clj-djl.ndarray.ndarray-creation-test
(:require [clojure.test :refer [deftest testing is]]
[clj-djl.ndarray :as nd]
[clj-djl.engine :as engine])
(:import [ai.djl.ndarray.types DataType]
[java.nio FloatBuffer]))
(deftest size-test
(let [ndm (nd/new-base-manager)]
(is (=... |
5070186fa4c1f27153f202d28fd4ede1f09d5fdf39adb94ad8bc90009b7977d5 | cljdoc/cljdoc | assets.clj | (ns cljdoc.render.assets
"Fetch 3rd party render assets for both cljdoc site and for downloaded offline bundles.
See resources/asset-deps.edn for 3rd party css and js assets."
(:require [clojure.java.io :as io]
[clojure.string :as string]
[clojure.tools.reader.edn :as edn]
[c... | null | https://raw.githubusercontent.com/cljdoc/cljdoc/246682b3dd0b003f27d9e9892a278724d898b464/src/cljdoc/render/assets.clj | clojure | (ns cljdoc.render.assets
"Fetch 3rd party render assets for both cljdoc site and for downloaded offline bundles.
See resources/asset-deps.edn for 3rd party css and js assets."
(:require [clojure.java.io :as io]
[clojure.string :as string]
[clojure.tools.reader.edn :as edn]
[c... | |
25cce5b25833e30ae6389881667cb849df745e3c307ab663c36c48f639f8d861 | informatimago/lisp | yarn-pattern.lisp | -*- mode : lisp;coding : utf-8 -*-
;;;;**************************************************************************
FILE : yarn-pattern.lisp
;;;;LANGUAGE: Common-Lisp
;;;;SYSTEM: Common-Lisp
USER - INTERFACE :
;;;;DESCRIPTION
;;;;
;;;; Example taken from
;;;;
;;;; This ... | null | https://raw.githubusercontent.com/informatimago/lisp/571af24c06ba466e01b4c9483f8bb7690bc46d03/pgl/examples/yarn-pattern.lisp | lisp | coding : utf-8 -*-
**************************************************************************
LANGUAGE: Common-Lisp
SYSTEM: Common-Lisp
DESCRIPTION
Example taken from
This program illustrates the use of the GLine class to simulate
winding a piece of colored yarn around a set of pegs... | FILE : yarn-pattern.lisp
USER - INTERFACE :
stretched from its current peg to the one DELTA pegs further on .
< PJB > < >
MODIFICATIONS
2015 - 11 - 13 < PJB > Created .
AGPL3
Copyright 2015 - 2016
it under the terms of the GNU Affero General Public License as ... |
11f4e17e0ab4d177570b4d520a158b5e637d03c9dc09c04ccfafd0bec696dc37 | hadolint/hadolint | Configfile.hs | module Hadolint.Config.Configfile
( getConfigFromFile
)
where
import Control.Monad (when, filterM)
import Data.Maybe (listToMaybe)
import Data.YAML as Yaml
import qualified Data.ByteString as Bytes
import Hadolint.Config.Configuration (PartialConfiguration (..))
import System.Directory
( XdgDirectory (..),
d... | null | https://raw.githubusercontent.com/hadolint/hadolint/bf7e48ea735db423a349fb2d7a83fe7a77091cc2/src/Hadolint/Config/Configfile.hs | haskell | - $(pwd)/.hadolint.{yaml|yml}
- $HOME/.config/hadolint.{yaml|yml}
- $HOME/.hadolint/{hadolint|config}.{yaml|yml}
- $HOME/.hadolint.{yaml|yml} | module Hadolint.Config.Configfile
( getConfigFromFile
)
where
import Control.Monad (when, filterM)
import Data.Maybe (listToMaybe)
import Data.YAML as Yaml
import qualified Data.ByteString as Bytes
import Hadolint.Config.Configuration (PartialConfiguration (..))
import System.Directory
( XdgDirectory (..),
d... |
6b188757e79689e90ab8e36fbf090bf3cbc9390d2e14cdd8b56895a7fc755cfa | agda/agda | Constraints.hs |
module Agda.TypeChecking.Monad.Constraints where
import Control.Arrow ((&&&))
import Control.Monad.Except
import Control.Monad.Reader
import qualified Data.Foldable as Fold
import qualified Data.List as List
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Semigroup ((<>))
import Agda.Interaction.... | null | https://raw.githubusercontent.com/agda/agda/4c159b909131761b6e1fc850ce0959d70b313657/src/full/Agda/TypeChecking/Monad/Constraints.hs | haskell | else
| Get the awake constraints
danger...
| Takes out all constraints matching given filter.
Danger! The taken constraints need to be solved or put back at some point.
| Suspend constraints matching the predicate during the execution of the
by events that would normally trigger a wakeup call.
| Monad ser... |
module Agda.TypeChecking.Monad.Constraints where
import Control.Arrow ((&&&))
import Control.Monad.Except
import Control.Monad.Reader
import qualified Data.Foldable as Fold
import qualified Data.List as List
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Semigroup ((<>))
import Agda.Interaction.... |
16ff9cc7975ba8a1fd64c6a3ce2cad7ba2bc07d576f8e178cdba520bb109f5a9 | manuel-serrano/bigloo | DER.scm | (module __crypto-DER
(export (encode-DER el p)
(decode-DER p))
(export (final-class DER-BitString
(data::bstring read-only)
(unused-bits::long read-only))
(final-class DER-Set
(set::pair-nil read-only))))
As of 2009 04 30 only a subset of DER is implemented . [ flo ]
;; We did not ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/api/crypto/src/Llib/DER.scm | scheme | We did not even try to be efficient.
ITU-T X.690
-T/studygroups/com10/languages/X.690_1297.pdf
found at -sys.com/asn1tutorial/node124.html
(reserved 0)
===============================================================================
identifier encoding/decoding
====================================================... | (module __crypto-DER
(export (encode-DER el p)
(decode-DER p))
(export (final-class DER-BitString
(data::bstring read-only)
(unused-bits::long read-only))
(final-class DER-Set
(set::pair-nil read-only))))
As of 2009 04 30 only a subset of DER is implemented . [ flo ]
(define *un... |
fdfd78d9a903602ad563a3d63f551cae42afa7018a644378dd0e5e6829c7a2c7 | paurkedal/batyr | api_protocol.ml | Copyright ( C ) 2022 < >
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This p... | null | https://raw.githubusercontent.com/paurkedal/batyr/2a1bfdde3929f820ea2c96b11c79991d7d6e2f5c/batyr-web/shared/api_protocol.ml | ocaml | Common
Message Counts
Fetch Messages | Copyright ( C ) 2022 < >
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This p... |
2b71366ee5a3ce756392e9801fe4df2344148f9d857746332ee9aa3428129c24 | glondu/belenios | events.mli | (**************************************************************************)
(* BELENIOS *)
(* *)
Copyright © 2012 - 2022
(* ... | null | https://raw.githubusercontent.com/glondu/belenios/64e71651d245ac58a0e909ae0f3c290356f780ee/src/lib/core/events.mli | ocaml | ************************************************************************
BELENIOS
This program is free softw... | Copyright © 2012 - 2022
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation , either version 3 of the
exemption that compiling , linking , and/or using OpenSSL is allowed .
You should have rece... |
4572c926c6197c295799455cb600d3452ea02b247a1268ab4346b2a5a4c47347 | metosin/muuntaja | interceptor_test.clj | (ns muuntaja.interceptor-test
(:require [clojure.test :refer :all]
[muuntaja.core :as m]
[muuntaja.interceptor :as interceptor]
[sieppari.core]
[muuntaja.core]))
(defn echo [request]
{:status 200
:body (:body-params request)})
(defn async-echo [request respond _]... | null | https://raw.githubusercontent.com/metosin/muuntaja/83da35f35518aaa02ef4d1ca6bbd007b781ebf84/test/muuntaja/interceptor_test.clj | clojure | without arguments
with default options
without arguments
with default options
"application/x-yaml"
"application/msgpack" | (ns muuntaja.interceptor-test
(:require [clojure.test :refer :all]
[muuntaja.core :as m]
[muuntaja.interceptor :as interceptor]
[sieppari.core]
[muuntaja.core]))
(defn echo [request]
{:status 200
:body (:body-params request)})
(defn async-echo [request respond _]... |
2af975060c9b8e4167375f18129cb0f82e1a6f6a636179f2c94f6862de4afff7 | thosmos/riverdb | service_test.clj | (ns riverdb.service-test
(:require [clojure.test :refer :all]
[io.pedestal.test :refer :all]
[io.pedestal.http :as bootstrap]
[riverdb.server :as server]
[mount.core :as mount]))
(declare service)
(defn my-test-fixture [f]
(mount/start-with-args {:config "config/dev... | null | https://raw.githubusercontent.com/thosmos/riverdb/b47f01a938da26298ee7924c8b2b3a2be5371927/src/test/riverdb/service_test.clj | clojure | Here we register my-test-fixture to be called once, wrapping ALL tests
in the namespace | (ns riverdb.service-test
(:require [clojure.test :refer :all]
[io.pedestal.test :refer :all]
[io.pedestal.http :as bootstrap]
[riverdb.server :as server]
[mount.core :as mount]))
(declare service)
(defn my-test-fixture [f]
(mount/start-with-args {:config "config/dev... |
894afeaeee616bda61557392d76adb4176b709ac7a71cd7e4799416600454d9a | icicle-lang/icicle-ambiata | Eval.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
{-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - missing - signatures #
module Icicle.Test.Core.Program.Eval where
import Icicle.Test.Arbitrary
-- import Icicle.Core.Program.Program
import Icicle.Core.Program.Check
... | null | https://raw.githubusercontent.com/icicle-lang/icicle-ambiata/9b9cc45a75f66603007e4db7e5f3ba908cae2df2/icicle-compiler/test/Icicle/Test/Core/Program/Eval.hs | haskell | # LANGUAGE OverloadedStrings #
import Icicle.Core.Program.Program
Just choose some date; it doesn't matter
Well typed programs don't go wrong
=====================
Restrict it to only good programs.
Evaluate on actual input | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Icicle.Test.Core.Program.Eval where
import Icicle.Test.Arbitrary
import Icicle.Core.Program.Check
import qualified Icicle . Core . Eval . Exp as XV
import qualified Icicle.... |
474b3c8a7e62da34cf854a6b02a77e95402873fe1be8eb2700daee01c476375d | danmey/ocaml-gui | widget3d.ml | class g
| null | https://raw.githubusercontent.com/danmey/ocaml-gui/e446fae0af7e0e07414c7970514e2d02166b4293/widget3d.ml | ocaml | class g
| |
799f258be9db4d87dbf11503daebda05746d9a82c730ff35eea9d9c1b2b08312 | mirage/metrics | metrics_lwt.mli |
* Copyright ( c ) 2018 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/mirage/metrics/139f9e2e5a74c8bc498d542708921138215e9bd6/src/lwt/metrics_lwt.mli | ocaml | * {!Lwt} monitoring.
The monitoring functions of this module return [Lwt] threads that proceed
only when the metric operation is over, as defined by the current
{!Metrics.reporter}.
{e %%VERSION%% - {{:%%PKG_HOMEPAGE%%} homepage}}
* {1 Metric Monitoring}
* [add src t f] adds a new data point to [src... |
* Copyright ( c ) 2018 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... |
2b605199298a409654b8692b2f4e859eab712a776a191d3b4a46b5528ea04880 | deadpendency/deadpendency | PackageYamlSpec.hs | module Effect.DetermineDependencies.Backend.LanguageFiles.Haskell.PackageYamlSpec (spec) where
import Common.Model.Dependency.Basic.BasicDependency
import Common.Model.Dependency.DependencyIdentifier
import Common.Model.Dependency.DependencyName
import Common.Model.Dependency.DependencyType
import Common.Model.Ecosyst... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/dependency-determiner/test/Effect/DetermineDependencies/Backend/LanguageFiles/Haskell/PackageYamlSpec.hs | haskell | module Effect.DetermineDependencies.Backend.LanguageFiles.Haskell.PackageYamlSpec (spec) where
import Common.Model.Dependency.Basic.BasicDependency
import Common.Model.Dependency.DependencyIdentifier
import Common.Model.Dependency.DependencyName
import Common.Model.Dependency.DependencyType
import Common.Model.Ecosyst... | |
72202ff5f086350c7b7887ee5628bc9c146d94d1974423846c5f30be579b18cc | full-spectrum/neo4clj | project.clj | (defproject com.github.full-spectrum/neo4clj-core "1.1.0"
:description "Neo4j core library and client"
:url "-spectrum/neo4clj"
:license {:name "The MIT License"
:url ""}
:dependencies [[camel-snake-kebab "0.4.3"]
[clojure.java-time "1.1.0"]
[org.clojure/clojure "1.... | null | https://raw.githubusercontent.com/full-spectrum/neo4clj/7dd2466da27cbeccd5494efe4ff20307d83d1153/neo4clj-core/project.clj | clojure | (defproject com.github.full-spectrum/neo4clj-core "1.1.0"
:description "Neo4j core library and client"
:url "-spectrum/neo4clj"
:license {:name "The MIT License"
:url ""}
:dependencies [[camel-snake-kebab "0.4.3"]
[clojure.java-time "1.1.0"]
[org.clojure/clojure "1.... | |
344848a8318c09e9884264310db32c4d38cfb411bf219158fd1e35fb4550d182 | qriollo/qriollo | Constraints.hs |
-- Este archivo es parte de Qriollo.
Qriollo is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
-- (at your option) any later version.
--
Qriollo is distributed in the... | null | https://raw.githubusercontent.com/qriollo/qriollo/b45ba0f4e9d444f786217ff931d7ecf74bfddbe4/src/Constraints.hs | haskell | Este archivo es parte de Qriollo.
(at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
For example
is represented by:
[
]
... |
Qriollo is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
Qriollo is distributed in the hope that it will be useful ,
You should have received a copy of the GNU Gen... |
0cfcd23e23634d4b77660335eda4bce3456c1aaf47935c9a63c56f0521584b2d | MaartenFaddegon/Hoed | Syntax.hs | # LANGUAGE DeriveGeneric #
module Syntax(Name, Expr(..), Command(..)) where
import Value
import Debug.Hoed.Pure
import Test.QuickCheck
import Control.Monad(liftM,liftM2,liftM3)
type Name = String
name :: Gen Name
name = elements ["x","y","z"]
data Expr
= Var Name
| Val Value
| Uno Op1 Expr
| Duo Op2 Expr Ex... | null | https://raw.githubusercontent.com/MaartenFaddegon/Hoed/8769d69e309928aab439b22bc3f3dbf5452acc77/examples/afp02Exercises/Compiler__with_properties/Syntax.hs | haskell | # LANGUAGE DeriveGeneric #
module Syntax(Name, Expr(..), Command(..)) where
import Value
import Debug.Hoed.Pure
import Test.QuickCheck
import Control.Monad(liftM,liftM2,liftM3)
type Name = String
name :: Gen Name
name = elements ["x","y","z"]
data Expr
= Var Name
| Val Value
| Uno Op1 Expr
| Duo Op2 Expr Ex... | |
bb2d02077bf613c774e77a70e67e03c5ff3c7988d030167ed05f947aa12fdd1d | tweag/asterius | ArithWord16.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE MagicHash #
# LANGUAGE UnboxedTuples #
module Main where
import Data.Word
import Data.Bits
import Data.List
import GHC.Prim
import GHC.Exts
main :: IO ()
main = do
--
Check if passing Word16 # on the stack works ( 16 parameter function will
-- need to use stack for... | null | https://raw.githubusercontent.com/tweag/asterius/e7b823c87499656860f87b9b468eb0567add1de8/asterius/test/ghc-testsuite/primops/ArithWord16.hs | haskell | # LANGUAGE BangPatterns #
need to use stack for some of the them)
notWord16#
subWord16#
timesWord16#
remWord16#
Don't divide by 0.
quotWord16#
quotRemWord16#
hence choosing a smaller range
# NOINLINE apply1 # | # LANGUAGE MagicHash #
# LANGUAGE UnboxedTuples #
module Main where
import Data.Word
import Data.Bits
import Data.List
import GHC.Prim
import GHC.Exts
main :: IO ()
main = do
Check if passing Word16 # on the stack works ( 16 parameter function will
let input =
[ ( (a + 0), (a + 1), (a + 2), (a + 3... |
5f28009e353ea7ef50d266d716a563b07b291f69ce5575b514db6a2e342a9096 | jpmonettas/old-flow-storm | api.clj | (ns flow-storm.api
"This is the only namespace intended for users.
Provides functionality to connect to the debugger and instrument forms."
(:require [flow-storm.instrument :as i]
[flow-storm.tracer :as t]
[clojure.pprint :as pp]
[clojure.repl :as clj.repl]
[cljs.re... | null | https://raw.githubusercontent.com/jpmonettas/old-flow-storm/6a43e0a9d3d9424564c008de2b1027208cd39d6e/src/flow_storm/api.clj | clojure | need to do this so multiarity macros work
Uncomment to debug
Printing on the *err* stream is important since | (ns flow-storm.api
"This is the only namespace intended for users.
Provides functionality to connect to the debugger and instrument forms."
(:require [flow-storm.instrument :as i]
[flow-storm.tracer :as t]
[clojure.pprint :as pp]
[clojure.repl :as clj.repl]
[cljs.re... |
04dbf9459f91d3871d62fce8ea09ce37720195276f1e2ee709585e803f168f12 | exercism/racket | collatz-conjecture.rkt | #lang racket
(provide collatz)
(define (collatz num)
(error "Not implemented yet"))
| null | https://raw.githubusercontent.com/exercism/racket/ce7b72cfde0695588771031d6b69d8d1cb199038/exercises/practice/collatz-conjecture/collatz-conjecture.rkt | racket | #lang racket
(provide collatz)
(define (collatz num)
(error "Not implemented yet"))
| |
92f17078cc6cb2da569e35ed707d377b4d0ffe8ae5a68eec7aff1ae7e43eeaea | denibertovic/denv | Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import RIO
import Data.Semigroup ((<>))
import Denv.Lib
import Denv.Options
import Options.Applicative
import System.Environment (getEnvironment)
main :: IO ()
main = do
env <- getEnvironment
execParser (opts env) >>= entrypoint
where
opts env =
i... | null | https://raw.githubusercontent.com/denibertovic/denv/86a3d612d8207daad75ad38a1711ad048e8f6113/app/Main.hs | haskell | # LANGUAGE OverloadedStrings # |
module Main where
import RIO
import Data.Semigroup ((<>))
import Denv.Lib
import Denv.Options
import Options.Applicative
import System.Environment (getEnvironment)
main :: IO ()
main = do
env <- getEnvironment
execParser (opts env) >>= entrypoint
where
opts env =
info
(helper <*> versionOpt ... |
56bb554a7e0633af9e36cec50e3beabceac8b003f5114f006661609d2f00559c | kuis-isle3sw/IoPLMaterials | arm_reg.ml | module S = Syntax
open Arm_spec
exception Error of string
let err s = raise (Error s)
= = = = メモリアクセス関連 = = = =
(* Reg.reg -> reg *)
let reg_mappings = [
(Reg.reserved_reg, Ip);
(0, V1);
(1, V2);
(2, V3);
(3, V4);
(4, V5);
(5, V6);
(6, V7);
]
let reg_of r = List.assoc r reg_mappings
(* 「reg中のアドレス... | null | https://raw.githubusercontent.com/kuis-isle3sw/IoPLMaterials/fa328e92fdaaf6986394f832ef689689930647cd/misc/miniml-compiler/arm_reg.ml | ocaml | Reg.reg -> reg
「reg中のアドレスからoffsetワード目」をあらわすaddr | module S = Syntax
open Arm_spec
exception Error of string
let err s = raise (Error s)
= = = = メモリアクセス関連 = = = =
let reg_mappings = [
(Reg.reserved_reg, Ip);
(0, V1);
(1, V2);
(2, V3);
(3, V4);
(4, V5);
(5, V6);
(6, V7);
]
let reg_of r = List.assoc r reg_mappings
let mem_access reg offset = RI (re... |
9eafbab4e72557a3a3aa7b57b0b63ba4fbeec08e241b8a6110538cc05d0284c7 | rpav/cl-xcb-xlib | xlib-wrappers.lisp | (in-package :xcb)
;; Basic wrapper for memory management
(defstruct (x-ptr-wrapper (:constructor make-x-ptr)
(:conc-name x-))
(ptr (null-pointer) :type #.(type-of (null-pointer)))
(type nil))
(defmethod print-object ((object x-ptr-wrapper) stream)
(print-unreadable-object (object st... | null | https://raw.githubusercontent.com/rpav/cl-xcb-xlib/1b00c44d4723b3a8334f36e731906d4679341c0e/src/xlib-wrappers.lisp | lisp | Basic wrapper for memory management
Avoid fatal X errors | (in-package :xcb)
(defstruct (x-ptr-wrapper (:constructor make-x-ptr)
(:conc-name x-))
(ptr (null-pointer) :type #.(type-of (null-pointer)))
(type nil))
(defmethod print-object ((object x-ptr-wrapper) stream)
(print-unreadable-object (object stream)
(format stream "~A [xval] {#x~8... |
7dcdc6494b74821abebbf25ba5729365bc8ab03bfd02ecb94990b43aa758d13f | cacheaudit/cacheaudit | cacheaudit.ml | Copyright ( c ) 2013 - 2015 , IMDEA Software Institute .
(* See ./LICENSE for authorship and licensing information *)
open AsmUtil
open X86Headers
open Config
let bin_name = ref ""
let start_addr = ref(-1 )
let end_addr = ref (-1)
let data_cache_s = ref 0
let data_line_s = ref 0
let data_assoc = ref 0
... | null | https://raw.githubusercontent.com/cacheaudit/cacheaudit/f0b52f85771ee31fed2a0a84a7e767a9d19e4b15/cacheaudit.ml | ocaml | See ./LICENSE for authorship and licensing information
may interrupt each x instruction
function which handles binary names (anonymous arguments)
("-f", Arg.String anon_fun, "give the name of the binary file");
Default register values before the start of the analysis
Setting default values
Analysis wil... | Copyright ( c ) 2013 - 2015 , IMDEA Software Institute .
open AsmUtil
open X86Headers
open Config
let bin_name = ref ""
let start_addr = ref(-1 )
let end_addr = ref (-1)
let data_cache_s = ref 0
let data_line_s = ref 0
let data_assoc = ref 0
let inst_cache_s = ref 0
let inst_line_s = ref 0
let inst_assoc =... |
bed034000e415c29ff933489aa2320e022a8dfccbf93885ddfe4bf329c038d94 | facebook/infer | SarifReport.mli |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/facebook/infer/9ec6cef8d1f48462919eff3e6758bb6a4f9a230e/infer/src/integration/SarifReport.mli | ocaml | * Read [report_json] and produce a textual output in [report_sarif]. |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
fda16aec93cde54dea8818fdc505109efc1a2190f659468e55f24dd3ffe92ab4 | dbuenzli/webs | pkg.ml | #!/usr/bin/env ocaml
#use "topfind"
#require "topkg"
open Topkg
let cmdliner = Conf.with_pkg "cmdliner"
let () =
Pkg.describe "webs" @@ fun c ->
let cmdliner = Conf.value c cmdliner in
Ok [
Pkg.mllib "src/webs.mllib";
Pkg.mllib "src/webs_kit.mllib" ~dst_dir:"kit";
Pkg.clib "src/libwebs_kit_stubs.clib... | null | https://raw.githubusercontent.com/dbuenzli/webs/88f71ec941c24d7783ba0bd7993cbae7df63c823/pkg/pkg.ml | ocaml | #!/usr/bin/env ocaml
#use "topfind"
#require "topkg"
open Topkg
let cmdliner = Conf.with_pkg "cmdliner"
let () =
Pkg.describe "webs" @@ fun c ->
let cmdliner = Conf.value c cmdliner in
Ok [
Pkg.mllib "src/webs.mllib";
Pkg.mllib "src/webs_kit.mllib" ~dst_dir:"kit";
Pkg.clib "src/libwebs_kit_stubs.clib... | |
fc2357cc06d247c54f59301b0fe26ac3156c64c0322369305798abfffdb606c7 | Lucccyo/chabyrinthe | maze2.ml | open Printf
type wall = {x: int; y:int; e_or_s: bool}
let l = int_of_string Sys.argv.(1)
let h = int_of_string Sys.argv.(2)
let hor_i x y = y * l + x
let ver_i x y = y * (l - 1) + x
let hor = Array.make (l * (h-1)) true (* _ *)
let ver = Array.make ((l-1) * h) true (* | *)
let add (arr, l) w =
arr.(!l) <- w;
... | null | https://raw.githubusercontent.com/Lucccyo/chabyrinthe/fbdb38d4968f4bbf42bfdca01ccb5c8db6057d89/randomized_prim/maze2.ml | ocaml | _
|
arr, l - 1
west
east
north
south | open Printf
type wall = {x: int; y:int; e_or_s: bool}
let l = int_of_string Sys.argv.(1)
let h = int_of_string Sys.argv.(2)
let hor_i x y = y * l + x
let ver_i x y = y * (l - 1) + x
let add (arr, l) w =
arr.(!l) <- w;
l := !l + 1
arr , l + 1
let remove (arr, l) r =
arr.(r) <- arr.(!l - 1);
l := !l - 1
... |
50ba77c3d7591e96b8d0695b8d59edd34aebfdf3eb89a48663269a06fd6ec358 | tanders/cluster-engine | 11.simple-tree.lisp | (in-package cluster-engine)
;;;;;;;
This is from the FLAT library
;; needs patch-work::x->dx and patch-work::dx->x
(defvar *default-nothead-no-pitch* '(62 :note-head :x))
(defconstant *extra-measure-color* 10000050)
(defun make-proportional-cell (dur-list)
(mapcar #'(lambda (dur) (* dur (apply 'lcm (mapcar 'deno... | null | https://raw.githubusercontent.com/tanders/cluster-engine/064ad4fd107f8d9a3dfcaf260524c2ab034c6d3f/sources/11.simple-tree.lisp | lisp |
needs patch-work::x->dx and patch-work::dx->x
grace notes ok
grace notes ok
append-pitch is a simpler and earlier version of append-pitch3.
subtree exist
pause in subtree
pause
empty = syncopation
pause starts on (or after) beat ending
beat ending needed as an event for calculation
(fuse-pauses
not a syncopation
fu... | (in-package cluster-engine)
This is from the FLAT library
(defvar *default-nothead-no-pitch* '(62 :note-head :x))
(defconstant *extra-measure-color* 10000050)
(defun make-proportional-cell (dur-list)
(mapcar #'(lambda (dur) (* dur (apply 'lcm (mapcar 'denominator dur-list))))
dur-list))
offset from 1 ... |
6d2cb28ebf857c7ab748373f7ac257a1ca553138db281028e2b5fbb469c48608 | f-me/carma-public | Case.hs | {-# LANGUAGE TypeOperators,
ScopedTypeVariables
#-}
module Snaplet.Search.Case where
import Data.String (fromString)
import Data.Text (Text)
import qualified Data.Text as T
import Text.Printf
import Database.PostgreSQL.Simple as PG
import ... | null | https://raw.githubusercontent.com/f-me/carma-public/82a9f44f7d919e54daa4114aa08dfec58b01009b/srv/src/Snaplet/Search/Case.hs | haskell | # LANGUAGE TypeOperators,
ScopedTypeVariables
# | module Snaplet.Search.Case where
import Data.String (fromString)
import Data.Text (Text)
import qualified Data.Text as T
import Text.Printf
import Database.PostgreSQL.Simple as PG
import Data.Model.Patch (Patch)
import Carma.Model.Case
import... |
a644bb83357d6b357386befe27089f42e0e1a9406caed7bdc0bfd40254a28d95 | agda/agda-ocaml | Main.hs | module Main (main) where
import qualified Agda.Compiler.Malfunction.Main as Malfunction
main :: IO ()
main = Malfunction.main
| null | https://raw.githubusercontent.com/agda/agda-ocaml/e38b699870ba638221828b07b12948d70a1bdaec/app/Main.hs | haskell | module Main (main) where
import qualified Agda.Compiler.Malfunction.Main as Malfunction
main :: IO ()
main = Malfunction.main
| |
3ec889873f298411744874839b37f79b940ef8c4c579588bc060f2d5c4b11044 | UCSD-PL/refscript | Module.hs | {-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveFunctor #
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TupleSections #
{-# LANGUAGE TypeSynonymInstances #-}
module Language.Rsc.... | null | https://raw.githubusercontent.com/UCSD-PL/refscript/884306fef72248ac41ecdbb928bbd7b06ca71bd4/src/Language/Rsc/Module.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeSynonymInstances #
* Modules
PV: take this somewhere else
------------------------------------------------------------------------------
| Modules
-------------------------------------------------... | # LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TupleSections #
module Language.Rsc.Module (
ModuleDefQ (..), ModuleDef
, moduleEnv
) where
import Control.Monad (foldM, liftM, void)
import Data.... |
ade00d4e3e6fed37d9976c78467ed0664d18171ecca584e0b4bdcfdc8acb4da6 | facebookarchive/lex-pass | Intercal.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
module Data.Intercal where
import Control.Arrow
import Control.Applicative
import Control.Monad
import Data.Binary
import Data.Data
import Prelude hiding (concatMap, map)
import qualified Prelude
import Common
import Parse
import Unparse
import Text.Pret... | null | https://raw.githubusercontent.com/facebookarchive/lex-pass/dcfa9560a95f2c1344e15493dabcc1645b1ca5e8/src/Data/Intercal.hs | haskell | # LANGUAGE DeriveDataTypeable #
this is a singleton "in b" and you would just use Interend if you wanted a
singleton "in a" | # LANGUAGE DeriveGeneric #
module Data.Intercal where
import Control.Arrow
import Control.Applicative
import Control.Monad
import Data.Binary
import Data.Data
import Prelude hiding (concatMap, map)
import qualified Prelude
import Common
import Parse
import Unparse
import Text.PrettyPrint.GenericPretty
data Intercal... |
b858529513f049a9e35b72629bbd50daf2669acb57818f13465d71d5267499d0 | haroldcarr/learn-haskell-coq-ml-etc | ControlledVisit.hs | module ControlledVisit where
-- "fix" imports
import Control.Monad (filterM, forM, liftM)
import System.Directory (doesDirectoryExist, getDirectoryContents, Permissions(..), getModificationTime, getPermissions)
import System . Time ( ClockTime ( .. ) ) -- deprecated
import Data.Time.Clock
import System.FilePath (t... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/book/2009-Real_World_Haskell/ControlledVisit.hs | haskell | "fix" imports
deprecated
Similar to "InfoP a" in previous versions.
Use "record" syntax.
Limitation:
can’t filter other names until after generating entire list of names in a tree.
Control which directories are entered and when (avoids recursing into directories)
Given
a function that takes a list of Info ... | module ControlledVisit where
import Control.Monad (filterM, forM, liftM)
import System.Directory (doesDirectoryExist, getDirectoryContents, Permissions(..), getModificationTime, getPermissions)
import Data.Time.Clock
import System.FilePath (takeExtension, (</>))
import Control.Exception (bracket, handle, SomeExcepti... |
159069b9d7139b9a29b3a1ccebbb2d31cf479fb515bcb366072e7cef08ccab2e | VictorTaelin/Caramel | Lambda.hs | # LANGUAGE ViewPatterns , GADTs , FlexibleInstances , ScopedTypeVariables #
Simple implementation of the Lambda Calculus .
module Lambda where
import qualified Data.IntMap as IM
-- The datatype of Lambda Calculus terms.
data Term
= Lam !Term
| App !Term !Term
| Var !Int
deriving (Show,Eq,Ord)
... | null | https://raw.githubusercontent.com/VictorTaelin/Caramel/4f77603cf5674e4187693b381c79316d9eac16dc/src/Lambda.hs | haskell | The datatype of Lambda Calculus terms.
Folds over a term.
Folds over a term with scoped/named variables (using Int names).
Pretty prints a term.
Reduces a strongly normalizing term to normal form.
Does not halt then the term isn't strongly normalizing.
Reduces a term to normal form through the host language. | # LANGUAGE ViewPatterns , GADTs , FlexibleInstances , ScopedTypeVariables #
Simple implementation of the Lambda Calculus .
module Lambda where
import qualified Data.IntMap as IM
data Term
= Lam !Term
| App !Term !Term
| Var !Int
deriving (Show,Eq,Ord)
HOAS term for normalization .
data HOAS... |
d304b1d8469667201930aee7db45358ffaaccb92434dca165990ac0a69cc6f20 | stettberger/ispositive | Spec.hs | module Main where
import Integer.IsPositive
import Test.Hspec
main :: IO ()
main = hspec $ do
describe "is_positive_integer" $ do
it "-1 is not a positive integer" $
is_positive_integer (-1) `shouldBe` False
it "0 is not a positive integer" $
is_positive_integer 0 `shouldBe` False
it "1 ... | null | https://raw.githubusercontent.com/stettberger/ispositive/c9ce01c3ea7c505d5e9428f9746aead93c7abebd/test/Spec.hs | haskell | module Main where
import Integer.IsPositive
import Test.Hspec
main :: IO ()
main = hspec $ do
describe "is_positive_integer" $ do
it "-1 is not a positive integer" $
is_positive_integer (-1) `shouldBe` False
it "0 is not a positive integer" $
is_positive_integer 0 `shouldBe` False
it "1 ... | |
176646282bd85f2bbd5921bc6df201f451fc6da2290f499f74cc9a443b77cced | jay-kumogata/MonadChip8 | PPU.hs | -- ----------------------------------------------------------------- --
-- --
PPU.hs : CHIP-8 --
-- --
2011/01/03 jay1905 ( based on 's implementation , --
... | null | https://raw.githubusercontent.com/jay-kumogata/MonadChip8/4af38bd6c678ba367d1c5afeff142caea41d62ec/PPU.hs | haskell | ----------------------------------------------------------------- --
--
--
--
--------------------------... |
module PPU (
PPU,
initPPU,
erasePPU,
setPixelPPU,
xorPixelPPU,
getPixelPPU,
memHEXFONT,
wFontTop,
memVRAM,
toVRAM,
nWidth,
nHeight,
) where
import Data.Bits
import Data.Int
import Data.Word
import Data.Array
import Control.Monad
import Text.Printf
data PPU = PPU... |
0c1c86509564a190aa2346a48b0a8715b062a293f1436d52cb87a8f80cfdbd26 | ocaml-sf/learn-ocaml-corpus | build_reverses_fork.ml | (* The data values carried by the leaves of a tree. *)
let rec elements t xs =
match t with
| Leaf x ->
x :: xs
| Fork (t, u) ->
elements t (elements u xs)
let elements (t : 'a tree) : 'a list =
elements t []
(* The depths of the leaves of a tree. *)
let rec depths d t ds =
match t with
| Le... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/spectre/wrong/build_reverses_fork.ml | ocaml | The data values carried by the leaves of a tree.
The depths of the leaves of a tree.
The elements and depths, combined.
A direct definition can also be given.
A facility for reading and consuming the elements of a list.
Reconstructing a tree from its spectre.
Premature end of input.
If this element lies ... |
let rec elements t xs =
match t with
| Leaf x ->
x :: xs
| Fork (t, u) ->
elements t (elements u xs)
let elements (t : 'a tree) : 'a list =
elements t []
let rec depths d t ds =
match t with
| Leaf _ ->
d :: ds
| Fork (t, u) ->
depths (d + 1) t (depths (d + 1) u ds)
let depths... |
ffee7d365ea477aee4e5e328167ab7c2e850628edc15701c29f7e4606a4d1c5a | lexi-lambda/racket-multimethod | info.rkt | #lang info
(define collection 'multi)
(define deps
'("base"
"multimethod-lib"
"multimethod-doc"))
(define build-deps
'())
(define implies
'("multimethod-lib"
"multimethod-doc"))
| null | https://raw.githubusercontent.com/lexi-lambda/racket-multimethod/8a0903ebaedd919971c382eeb785f05080c7a8d6/multimethod/info.rkt | racket | #lang info
(define collection 'multi)
(define deps
'("base"
"multimethod-lib"
"multimethod-doc"))
(define build-deps
'())
(define implies
'("multimethod-lib"
"multimethod-doc"))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.