_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 |
|---|---|---|---|---|---|---|---|---|
c9c211c6ebfed722c1b42c0c74fd81c98381eb77380a2aa59b2b0b23933510a7 | imrehg/ypsilon | drawing.scm | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gtk drawing)
(export gtk_drawing_area_get_type
gtk_drawing_area_new)
(import (rnrs) (ypsilon ffi))
(define lib-name
(c... | null | https://raw.githubusercontent.com/imrehg/ypsilon/e57a06ef5c66c1a88905b2be2fa791fa29848514/sitelib/ypsilon/gtk/drawing.scm | scheme | [end] | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gtk drawing)
(export gtk_drawing_area_get_type
gtk_drawing_area_new)
(import (rnrs) (ypsilon ffi))
(define lib-name
(c... |
0f8d68e62dd2b19ed56adc16b1186aebbe12819e43f44ce023520f1456de7fb7 | mentat-collective/emmy | sci.cljc | #_"SPDX-License-Identifier: GPL-3.0"
(ns emmy.env.sci
(:refer-clojure :exclude [ns-map])
(:require [emmy.env]
[emmy.env.sci.macros :as macros]
[emmy.util :as u]
[sci.core :as sci]))
(def macro? (comp :macro meta))
(def dynamic? (comp :dynamic meta))
(defn ns-macros
"Given a ... | null | https://raw.githubusercontent.com/mentat-collective/emmy/90a1de10e78187c70d546c3cfd63c8d32b783bed/src/emmy/env/sci.cljc | clojure | Inside SCI, macros are replaced by rewritten-as-functions
versions of themselves, with additional slots for `&form` and
`&env`. We exclude them here so they can be replaced later.
Keep dynamic variables as unresolved vars, so that they can
at least be inspected (at which point they'll reveal any
rebindings applie... | #_"SPDX-License-Identifier: GPL-3.0"
(ns emmy.env.sci
(:refer-clojure :exclude [ns-map])
(:require [emmy.env]
[emmy.env.sci.macros :as macros]
[emmy.util :as u]
[sci.core :as sci]))
(def macro? (comp :macro meta))
(def dynamic? (comp :dynamic meta))
(defn ns-macros
"Given a ... |
2e442eec9afdfe336d9bcfe5ccf993311c518ffa8a486792519990d3fcacee4a | racket/picturing-programs | book-pictures.rkt | #lang racket/base
Initial version , Dec. 13 , 2010 .
; Doesn't work with a literal image, but it works to use a "bitmap"
reference to a file that 's included with the teachpacks . Dec. 21 , 2010 .
(require (only-in 2htdp/image bitmap))
(provide (prefix-out pic: (all-defined-out)))
(define bloch (bitmap "pictur... | null | https://raw.githubusercontent.com/racket/picturing-programs/9061b6c6f93a2aeba58a785a75c324225e12a47c/picturing-programs/private/book-pictures.rkt | racket | Doesn't work with a literal image, but it works to use a "bitmap" | #lang racket/base
Initial version , Dec. 13 , 2010 .
reference to a file that 's included with the teachpacks . Dec. 21 , 2010 .
(require (only-in 2htdp/image bitmap))
(provide (prefix-out pic: (all-defined-out)))
(define bloch (bitmap "pictures/bloch.png"))
(define hieroglyphics (bitmap "pictures/small_hierog... |
52fbdd4a7e16eed1fbd5621a37c8f5cac921c30c9ec9fbc5c65f9668a4117789 | lnostdal/SymbolicWeb | session.clj | (in-ns 'symbolicweb.core)
(defn %mk-SessionTable []
(swsync
(db-stmt
"
CREATE TABLE sessions (
id bigserial NOT NULL,
created timestamp without time zone NOT NULL,
touched timestamp without time zone NOT NULL,
json text DEFAULT '{}'::text NOT NULL,
application text NOT NULL,
uuid tex... | null | https://raw.githubusercontent.com/lnostdal/SymbolicWeb/d9600b286f70f88570deda57b05ca240e4e06567/src/symbolicweb/session.clj | clojure |
Dummy.
permanent."
permanent."
temporarily."
temporarily."
Only sent to VIEWPORT (i.e. not entire SESSION which might be 'stolen'!) doing the actual login.
NOTE: COOKIE-VALUE is stored in the :UUID field of Session.
Don't bother trying if this isn't given.
Not supplied so we assume false. | (in-ns 'symbolicweb.core)
(defn %mk-SessionTable []
(swsync
(db-stmt
"
CREATE TABLE sessions (
id bigserial NOT NULL,
created timestamp without time zone NOT NULL,
touched timestamp without time zone NOT NULL,
json text DEFAULT '{}'::text NOT NULL,
application text NOT NULL,
uuid tex... |
01f5d4488580936457cc694da22f2c087f44d895499f4130a9f79f876b2933db | penpot/penpot | text.cljs | 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) KALEIDOS INC
(ns app.main.ui.shapes.text
(:require
[app.common.text :as txt]
[app.main.fonts :as fonts]
[app.mai... | null | https://raw.githubusercontent.com/penpot/penpot/c3ce0eb7945b5412f72a50e55312a7341387ba51/frontend/src/app/main/ui/shapes/text.cljs | clojure |
Copyright (c) KALEIDOS INC
Old components can have texts without position data that must be rendered via foreign key | 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 /.
(ns app.main.ui.shapes.text
(:require
[app.common.text :as txt]
[app.main.fonts :as fonts]
[app.main.ui.context :as ctx]
[app.mai... |
f8dbbfe8bebea33740d9427e07b4f0f632d319a0a8b6441dcf79b7098b835408 | nyu-acsys/drift | enc-zip.ml |
let rec zip x y =
if x = 0
then
if y = 0
then 0
else (assert(false); y)
else
if y = 0
then (assert(false); x)
else 1 + zip (x - 1) (y - 1)
let main_p (n:int) =
assert (zip n n = n)
let main (w:unit) =
let _ = main_p 100 in
let _ =
for i = 1 to 1000000 do
main ( Random... | null | https://raw.githubusercontent.com/nyu-acsys/drift/51a3160d74b761626180da4f7dd0bb950cfe40c0/tests/benchmarks_call/r_type/first/enc-zip.ml | ocaml |
let rec zip x y =
if x = 0
then
if y = 0
then 0
else (assert(false); y)
else
if y = 0
then (assert(false); x)
else 1 + zip (x - 1) (y - 1)
let main_p (n:int) =
assert (zip n n = n)
let main (w:unit) =
let _ = main_p 100 in
let _ =
for i = 1 to 1000000 do
main ( Random... | |
39d6de9ddd676e63eca82c165d8dd8803a2c9c95f46e9570ee68c690e6876958 | c-cube/ocaml-chord | dhtBroadcast.ml |
Copyright ( c ) 2013 ,
All rights reserved .
Redistribution and use in source and binary forms , with or without
modification , are permitted provided that the following conditions are met :
Redistributions of source code must retain the above copyright notice , this
list of conditions and the following... | null | https://raw.githubusercontent.com/c-cube/ocaml-chord/74b25d2d5574291b7c37dc7f4c4f569c7bc4ccf4/src/dhtBroadcast.ml | ocaml | * {1 Broadcasting}
* Enable broadcasting on this DHT instance
* Enable log messages
* Broadcast the value to every other node in the DHT
* Received broadcasted values
* Messages broadcasted from this very node
* Wait for the next broadcasted message
broadcast the given message [msg], up to [limit_id]
right ch... |
Copyright ( c ) 2013 ,
All rights reserved .
Redistribution and use in source and binary forms , with or without
modification , are permitted provided that the following conditions are met :
Redistributions of source code must retain the above copyright notice , this
list of conditions and the following... |
d5136f3c1bd2299839c19e940bcc846e5ce8456310da95b7a96589bedcd58cb7 | Kappa-Dev/KappaTools | manager_simulation.ml | (******************************************************************************)
(* _ __ * The Kappa Language *)
| |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
(* | ' / ********************************************************************... | null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/b34ac13c13faf0b784d328ad61c9fc2338ae2fc6/core/api/manager_simulation.ml | ocaml | ****************************************************************************
_ __ * The Kappa Language
| ' / ********************************************************************
| . \ * This file is distributed under the terms of the
|_|\_\ * GN... | | |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
open Lwt.Infix
let patch_parameter (simulation_parameter : Api_types_t.simulation_parameter) :
(Api_types_t.simulation_parameter*int) =
match simulation_parameter.Api_types_t.simulation_seed with
| None ->
let () = Random.self_in... |
fcfb4db6e84bba9bf032f402f43b1d0b30196335a90c8aaa2e1c7a2ffbfa54af | shentufoundation/deepsea | Nat0.ml | open Datatypes
open Decimal
* add : nat - > nat - > nat *
let rec add n m =
match n with
| O -> m
| S p -> S (add p m)
* : nat - > nat - > nat *
let rec mul n m =
match n with
| O -> O
| S p -> add m (mul p m)
(** val sub : nat -> nat -> nat **)
let rec sub n m =
match n with
| O -> n
| S k -... | null | https://raw.githubusercontent.com/shentufoundation/deepsea/970576a97c8992655ed2f173f576502d73b827e1/src/backend/extraction/Nat0.ml | ocaml | * val sub : nat -> nat -> nat *
* val tail_addmul : nat -> nat -> nat -> nat *
* val of_uint : uint -> nat * | open Datatypes
open Decimal
* add : nat - > nat - > nat *
let rec add n m =
match n with
| O -> m
| S p -> S (add p m)
* : nat - > nat - > nat *
let rec mul n m =
match n with
| O -> O
| S p -> add m (mul p m)
let rec sub n m =
match n with
| O -> n
| S k -> (match m with
| O -> n... |
5a2cfd5112428cf7a26eb66b1ee0f198e216f133d8a3a14f55f1a98c5b7be427 | hstreamdb/hstream | Command.hs | module HStream.Admin.Store.Command
( module HStream.Admin.Store.Command.NodesConfig
, module HStream.Admin.Store.Command.Status
, module HStream.Admin.Store.Command.Config
, module HStream.Admin.Store.Command.Logs
, module HStream.Admin.Store.Command.CheckImpact
, module HStream.Admin.Store.Command.Maintena... | null | https://raw.githubusercontent.com/hstreamdb/hstream/efb859d3e9433c61ba72f35469612f5476b8be96/hstream-admin/store/HStream/Admin/Store/Command.hs | haskell | module HStream.Admin.Store.Command
( module HStream.Admin.Store.Command.NodesConfig
, module HStream.Admin.Store.Command.Status
, module HStream.Admin.Store.Command.Config
, module HStream.Admin.Store.Command.Logs
, module HStream.Admin.Store.Command.CheckImpact
, module HStream.Admin.Store.Command.Maintena... | |
946bec54b48ec2565fc97c6ea73f9bb725a4b88d74bc8e4d3888c1daf480a83a | conscell/hugs-android | Mem.hs | -----------------------------------------------------------------------------
-- |
-- Module : System.Mem
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
-- ... | null | https://raw.githubusercontent.com/conscell/hugs-android/31e5861bc1a1dd9931e6b2471a9f45c14e3c6c7e/hugs/lib/hugs/packages/base/System/Mem.hs | haskell | ---------------------------------------------------------------------------
|
Module : System.Mem
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : provisional
Portability : portable
Memory-related system things.
---------------------------------------------... | Copyright : ( c ) The University of Glasgow 2001
module System.Mem (
) where
import Prelude
import Hugs.IOExts
|
2c02afe50270df7496270acd9976a2c651ec906914be90d2f49fb4e09c24df97 | borodust/bodge-ui | rendering.lisp | (cl:in-package :bodge-ui)
(declaim (special *command*
*renderer*))
(defgeneric compose (element))
(defgeneric render-custom-widget (widget origin width height)
(:method (widget origin width height)
(declare (ignore widget origin width height))))
(defun bodge-color (nk-color)
(c-val ((n... | null | https://raw.githubusercontent.com/borodust/bodge-ui/db896ca3be9026444398e0192a48b048aa7db574/src/rendering.lisp | lisp | (cl:in-package :bodge-ui)
(declaim (special *command*
*renderer*))
(defgeneric compose (element))
(defgeneric render-custom-widget (widget origin width height)
(:method (widget origin width height)
(declare (ignore widget origin width height))))
(defun bodge-color (nk-color)
(c-val ((n... | |
b8589619f8f28d7676741666a119c771aec9fab33b4d170d09dd5f24068a239a | argp/bap | ed_hyper.ml | (**************************************************************************)
(* *)
: a generic graph library for OCaml
Copyright ( C ) 2004 - 2010
, and
(* ... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/ocamlgraph/editor/ed_hyper.ml | ocaml | ************************************************************************
This software is free software; you can redistribute it and/or
described in file LICENSE.... | : a generic graph library for OCaml
Copyright ( C ) 2004 - 2010
, and
modify it under the terms of the GNU Library General Public
License version 2.1 , with the special exception on linking
This co... |
2a86f28ebb6fbe8d886bec2dc722cb148878fc644d39518a167080a5dfc0ddc9 | haskell/directory | FindFile001.hs | # LANGUAGE CPP #
module FindFile001 where
#include "util.inl"
import qualified Data.List as List
import System.Directory.Internal
import System.OsPath ((</>))
main :: TestEnv -> IO ()
main _t = do
createDirectory "bar"
createDirectory "qux"
writeFile "foo" ""
writeFile (so ("bar" </> "foo")) ""
writeFile (s... | null | https://raw.githubusercontent.com/haskell/directory/c1895b93a49a9723c949eefef71b0855b4ee5d51/tests/FindFile001.hs | haskell | make sure findFile is lazy enough
make sure relative paths work
make sure absolute paths are handled properly irrespective of 'dirs'
| # LANGUAGE CPP #
module FindFile001 where
#include "util.inl"
import qualified Data.List as List
import System.Directory.Internal
import System.OsPath ((</>))
main :: TestEnv -> IO ()
main _t = do
createDirectory "bar"
createDirectory "qux"
writeFile "foo" ""
writeFile (so ("bar" </> "foo")) ""
writeFile (s... |
9735a0f864c143d076886ae6d19868ea69433d9d23141ef502fb39c4485fa4fc | the-concurrent-schemer/scm | scml_base_control.erl | %%% The MIT License
%%%
Copyright ( C ) 2013 - 2014 by < >
%%%
%%% Permission is hereby granted, free of charge, to any person obtaining a copy
%%% of this software and associated documentation files (the "Software"), to deal
in the Software without restriction , including without limitation the rights
%%% to u... | null | https://raw.githubusercontent.com/the-concurrent-schemer/scm/1726ec2e94e766893d80c286f816599defb6a524/src/scml_base_control.erl | erlang | The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above... | Copyright ( C ) 2013 - 2014 by < >
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , E... |
26dd6e8743a278b0eaf7652656f91dd9418ac069b04a02fbcc64066b15f72a1d | iu-parfunc/lvars | Main.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
module Main where
import Data.Int
import qualified Data.Vector.Storable as SV
import qualified Data.Vector.Storable.Mutable as SVM
import Criterion
import Criterion.Main
... | null | https://raw.githubusercontent.com/iu-parfunc/lvars/78e73c96a929aa75aa4f991d42b2f677849e433a/src/par-mergesort/bench/Main.hs | haskell | # LANGUAGE ConstraintKinds #
TODO: Add vector-algortihms benchmarks.
TODO(osa): Thresholds should be varying?
| Out of place sort on immutable vectors.
TODO(osa): Copied from tests, maybe copy to a shared place.
returning mutable one.
| Sort the vector in the left component of the state.
(_, right) <- ... | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
module Main where
import Data.Int
import qualified Data.Vector.Storable as SV
import qualified Data.Vector.Storable.Mutable as SVM
import Criterion
import Criterion.Main
import Control.LVish ... |
698f94393d7c37c910606481c83c2e57ea910eccd5398ddaa3945e34d6a031e1 | philnguyen/soft-contract | ex-05.rkt | #lang racket
(require soft-contract/fake-contract)
(define (f x y)
(if (and (number? x) (string? y)) (+ x (string-length y)) #|HERE|# (+ x y)))
(provide/contract [f (any/c any/c . -> . number?)])
| null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/unsafe/octy/ex-05.rkt | racket | HERE | #lang racket
(require soft-contract/fake-contract)
(define (f x y)
(provide/contract [f (any/c any/c . -> . number?)])
|
7a67cc3df416f9fe6b13de1386539d5aef9accf48e5c0b65eed215a6b7fb82fc | huangz1990/real-world-haskell-cn | QC-basics.hs | file : ch11 / QC - basics.hs
import Test.QuickCheck
import Data.List
file : ch11 / QC - basics.hs
qsort :: Ord a => [a] -> [a]
qsort [] = []
qsort (x:xs) = qsort lhs ++ [x] ++ qsort rhs
where lhs = filter (< x) xs
rhs = filter (>= x) xs
file : ch11 / QC - basics.hs
prop_idempotent xs = qsort... | null | https://raw.githubusercontent.com/huangz1990/real-world-haskell-cn/f67b07dd846b1950d17ff941d650089fcbbe9586/code/ch11/QC-basics.hs | haskell | file : ch11 / QC - basics.hs
import Test.QuickCheck
import Data.List
file : ch11 / QC - basics.hs
qsort :: Ord a => [a] -> [a]
qsort [] = []
qsort (x:xs) = qsort lhs ++ [x] ++ qsort rhs
where lhs = filter (< x) xs
rhs = filter (>= x) xs
file : ch11 / QC - basics.hs
prop_idempotent xs = qsort... | |
76fd2dfb401f0aa3bc62cec3a30b9cd5676173d0efe5cbed816ae91e097ad997 | eglaysher/rldev | main.ml |
RlXml : convert RealLive auxiliary file formats < > XML
Copyright ( C ) 2006 Haeleth
This program is free software ; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation ; either version 2 of the License , or ( ... | null | https://raw.githubusercontent.com/eglaysher/rldev/e59103b165e1c20bd940942405b2eee767933c96/src/rlxml/main.ml | ocaml | Option definitions
Short options used: ov
Create an output directory if necessary. |
RlXml : convert RealLive auxiliary file formats < > XML
Copyright ( C ) 2006 Haeleth
This program is free software ; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation ; either version 2 of the License , or ( ... |
e3a2e356d32220c192e30188c0b69ff0adc49dc4c0cba060c0294c3788afbe91 | metametadata/carry | util.cljs | (ns app.util)
(defn tagged
"Helper function decorator which prepends a tag to the single argument.
I.e. it transforms an arg x to [tag x]."
[f tag]
(fn tagged-fn
[x]
(f [tag x]))) | null | https://raw.githubusercontent.com/metametadata/carry/fa5c7cd0d8f1b71edca70330acc97c6245638efb/examples/counter-list/src/app/util.cljs | clojure | (ns app.util)
(defn tagged
"Helper function decorator which prepends a tag to the single argument.
I.e. it transforms an arg x to [tag x]."
[f tag]
(fn tagged-fn
[x]
(f [tag x]))) | |
fe9f5784f21c7928c2376eec2dd70cc3adef8fe9e6ff4c409b9c7e5c34421092 | ocurrent/ocaml-ci | analyse_ocamlformat.ml | let ( >>!= ) = Lwt_result.Infix.( >>= )
type source =
| Opam of { version : string; opam_repo_commit : string }
| Vendored of { path : string }
[@@deriving yojson, eq, ord]
let pp_source f = function
| Opam { version; _ } -> Fmt.pf f "version %s (from opam)" version
| Vendored { path } -> Fmt.pf f "vendored a... | null | https://raw.githubusercontent.com/ocurrent/ocaml-ci/ed1153393959476c1cc2c464c913110c31859a4a/lib/analyse_ocamlformat.ml | ocaml | Search for any .ocamlformat-enable files as a disabled ocamlformat would
still format things if a ocamlformat-enable file is present
This case happens when the ocamlformat file doesn't specify a version.
It will try to get the latest version for the last platform. | let ( >>!= ) = Lwt_result.Infix.( >>= )
type source =
| Opam of { version : string; opam_repo_commit : string }
| Vendored of { path : string }
[@@deriving yojson, eq, ord]
let pp_source f = function
| Opam { version; _ } -> Fmt.pf f "version %s (from opam)" version
| Vendored { path } -> Fmt.pf f "vendored a... |
45bdfaa525f89128a75bb9257074da576e4252938cda6cf9d8734521511d6362 | robrix/isometry | Test.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
module Data.IntervalSet.Test
( tests
, isDisjoint
) where
import Control.Monad (join)
import Data.Functor.I
import Data.Functor.Interval
import Data.IntervalSet as I
import Da... | null | https://raw.githubusercontent.com/robrix/isometry/171b9261b8d7ea32c86ce6019c8c3973742f0349/test/Data/IntervalSet/Test.hs | haskell | # LANGUAGE OverloadedStrings #
prop_delete_disjoint = property $ do
s <- forAll gs
i <- forAll gi
holds isDisjoint $ toList (delete i s) | # LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
module Data.IntervalSet.Test
( tests
, isDisjoint
) where
import Control.Monad (join)
import Data.Functor.I
import Data.Functor.Interval
import Data.IntervalSet as I
import Data.Maybe (fromMaybe)
import ... |
e8dc03e3e7cdb3fa484384d47740534c32e45e911ed8dcf99dcca59e58d38a70 | futurice/haskell-mega-repo | KleeneSwagger.hs | {-# LANGUAGE RankNTypes #-}
module Futurice.KleeneSwagger (
RE, sym, psym, msym, anySym,
operationsMatching,
) where
import Control.Lens (indices, itraversed)
import Data.List.Split (splitOn)
import Data.Maybe (isJust)
import Futurice.Prelude
import Prelude ()
import Text.Regex... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/futurice-servant/src/Futurice/KleeneSwagger.hs | haskell | # LANGUAGE RankNTypes # | module Futurice.KleeneSwagger (
RE, sym, psym, msym, anySym,
operationsMatching,
) where
import Control.Lens (indices, itraversed)
import Data.List.Split (splitOn)
import Data.Maybe (isJust)
import Futurice.Prelude
import Prelude ()
import Text.Regex.Applicative (RE, anySym, ma... |
de72627483ffd4aad52f111d10cb1e7600ff9eb4cdb1be887f7affb65f842df7 | ocaml-multicore/eventlog-tools | eventlog.ml | include Types
module Parser = Parser
| null | https://raw.githubusercontent.com/ocaml-multicore/eventlog-tools/9ed1e4f50ad935c43d6d5a44efc7ed43e381233b/lib/eventlog.ml | ocaml | include Types
module Parser = Parser
| |
fa7eadd07dcd737823564045b806a5b5650374211cc596130cb3435398a038dd | obsidiansystems/beam-automigrate | Main.hs | # LANGUAGE LambdaCase #
module Main where
import Control.Monad.IO.Class (liftIO)
import Data.Proxy
import Database.Beam.AutoMigrate
import Database.Beam.AutoMigrate.BenchUtil (cleanDatabase)
import Database.Beam.AutoMigrate.Postgres (getSchema)
import Database.Beam.AutoMigrate.TestUtils
import Database.Beam.Postgres
... | null | https://raw.githubusercontent.com/obsidiansystems/beam-automigrate/2eae891814b0523c6c839a666eed19218985a89f/integration-tests/Main.hs | haskell | We test that if we generate and apply a migration from a 'hsSchema', when we read the
'Schema' back from the DB, we should end up with the original 'hsSchema'.
We test that after a successful migration, calling 'diff' should yield no edits.
| Execute a monadic 'Property' while also cleaning up any database's data a... | # LANGUAGE LambdaCase #
module Main where
import Control.Monad.IO.Class (liftIO)
import Data.Proxy
import Database.Beam.AutoMigrate
import Database.Beam.AutoMigrate.BenchUtil (cleanDatabase)
import Database.Beam.AutoMigrate.Postgres (getSchema)
import Database.Beam.AutoMigrate.TestUtils
import Database.Beam.Postgres
... |
39d30c872db848da5a447f63c2ac5bd0b88607cada22447585b3325607bb5255 | vaibhavsagar/experiments | XPathNodeType.hs | module Dotnet.System.Xml.XPath.XPathNodeType where
import Dotnet
import qualified IOExts
import qualified Dotnet.System.Type
import qualified Dotnet.System.Enum
data XPathNodeType_ a
type XPathNodeType a = Dotnet.System.Enum.Enum (XPathNodeType_ a)
data XPathNodeTypeTy
= Root
| Element
| Attribute
| Namespace
|... | null | https://raw.githubusercontent.com/vaibhavsagar/experiments/378d7ba97eabfc7bbeaa4116380369ea6612bfeb/hugs/dotnet/lib/Dotnet/System/Xml/XPath/XPathNodeType.hs | haskell | module Dotnet.System.Xml.XPath.XPathNodeType where
import Dotnet
import qualified IOExts
import qualified Dotnet.System.Type
import qualified Dotnet.System.Enum
data XPathNodeType_ a
type XPathNodeType a = Dotnet.System.Enum.Enum (XPathNodeType_ a)
data XPathNodeTypeTy
= Root
| Element
| Attribute
| Namespace
|... | |
6711455c5c715fc6f5904b70122263baade2083d75ddd03e202e1aa5ec5fc8a3 | FlowForwarding/lincx | linc_us3_port_sup.erl | %%------------------------------------------------------------------------------
Copyright 2012 FlowForwarding.org
%%
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
%%... | null | https://raw.githubusercontent.com/FlowForwarding/lincx/7795923b51fa1e680511669f4a27404b2ed1f1dc/apps/linc_us3/src/linc_us3_port_sup.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, eithe... | Copyright 2012 FlowForwarding.org
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author Erlang Solutions Ltd. < >
2012 FlowForwarding.org
-module(linc_us3_port_sup).
-behaviour(supervisor).
-export([start_link/1]... |
9917b24bf5bf5b5df72b8d131760d1351f87d4daa523e58d2d01bcd9d83515f3 | atgreen/cl-etcd | etcd-test.lisp | ;; Simple example. Warning -- not much thought was put into
;; concurrency issues.
(defpackage #:etcd-test
(:use #:cl)
(:shadow #:package)
(:export #:start))
(in-package :etcd-test)
(defvar *leader?* nil)
;; This method is called when I become leader.
(defun become-leader (etcd)
(format t "**** I AM THE LE... | null | https://raw.githubusercontent.com/atgreen/cl-etcd/0f3c1ae91edcbc0627a2fe65df8c1842e5677bbe/test/etcd-test.lisp | lisp | Simple example. Warning -- not much thought was put into
concurrency issues.
This method is called when I become leader.
This method is called when I become a follower.
Future versions shouldn't need this sleep. with-etcd should
wait until etcd is ready to accept client traffic. |
(defpackage #:etcd-test
(:use #:cl)
(:shadow #:package)
(:export #:start))
(in-package :etcd-test)
(defvar *leader?* nil)
(defun become-leader (etcd)
(format t "**** I AM THE LEADER ***********~%")
(setf *leader?* t)
(setf (cl-etcd:get-etcd "hello" etcd) "world"))
(defun become-follower (etcd)
(forma... |
3715cc11c4bb0156ca6aa7f4c038992e7d84b6326f50b45461fe9f4eb08c6392 | INRIA/zelus | zlsdep.ml | (* Warning: *)
This file is based on the original version of ocamldep.ml
from the Objective Caml 3.12 distribution , INRIA
(***********************************************************************)
(* *)
(* Ob... | null | https://raw.githubusercontent.com/INRIA/zelus/8dca7e80a71c39ae5ff9e9ae640854e60a27aadd/tools/zlsdep.ml | ocaml | Warning:
*********************************************************************
Objective Caml
... | This file is based on the original version of ocamldep.ml
from the Objective Caml 3.12 distribution , INRIA
, projet Cristal , INRIA Rocquencourt
Copyright 1999 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distr... |
3d2c975e907565aec495ebd0dbd53836e845252ec174d3d68f80ca2ec02c2cb0 | inria-parkas/sundialsml | idas_adj_skel.ml | open Sundials
TODO : write a proper and working example ...
(* TODO: include the quadrature module in this skeleton. *)
Initialize a session [ s ] per the skeleton at { ! Ida.init }
module Adj = Idas.Adjoint
...
(* Adding quadrature variables using {!Quadrature.init} if desired.
Initial value correction, if n... | null | https://raw.githubusercontent.com/inria-parkas/sundialsml/0c46b0c6c067677af6ef8006260b9e697cc0562b/examples/ocaml/skeletons/idas_adj_skel.ml | ocaml | TODO: include the quadrature module in this skeleton.
Adding quadrature variables using {!Quadrature.init} if desired.
Initial value correction, if needed, should be held off
until sensitivity calculations are activated below.
Integrate forward problem
Setup the backward problem and attach a linear solver ... | open Sundials
TODO : write a proper and working example ...
Initialize a session [ s ] per the skeleton at { ! Ida.init }
module Adj = Idas.Adjoint
...
Initialize the adjoint computation
init s nsteps IHermite
let t, ncheck, r = forward_normal s tout y0
let yB0 = RealArray.of_list [0.0; 0.0; ...]
let yB'0 ... |
5a0b6f8cdea64c3a4559055145cf7af5436e59c909cd4002b91407f2b1e2d801 | ygrek/mldonkey | commonDownloads.ml | Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
... | null | https://raw.githubusercontent.com/ygrek/mldonkey/333868a12bb6cd25fed49391dd2c3a767741cb51/src/daemon/common/commonDownloads.ml | ocaml | the file being downloaded
the position in the file
end;
lprintf "NEW SOURCE POS %s\n" (Int64.to_string c.client_pos);
| Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
... |
eac8a29daa2021a3ee48ca91312f0255011b72781ff1f20876a9bdd793000423 | nedap/formatting-stack | should_not_be_cleaned_5.clj | (ns functional.formatting-stack.formatters.clean-ns.should-not-be-cleaned-5
(:require
[specs.foo]))
| null | https://raw.githubusercontent.com/nedap/formatting-stack/c43e74d5409e9338f208457bb8928ce437381a3f/test/functional/formatting_stack/formatters/clean_ns/should_not_be_cleaned_5.clj | clojure | (ns functional.formatting-stack.formatters.clean-ns.should-not-be-cleaned-5
(:require
[specs.foo]))
| |
c1b8aabfc361f323f57465046983331bb83eaf587e5d68170ddc2f09a4daa29e | JHU-PL-Lab/jaylang | inductive6-3.ml | let f g x =
if x > 0 then
g x
else
1
let decr x = x - 1
let main n = if n >= 3 || n <= 0 then assert(f decr n > 0) else ()
| null | https://raw.githubusercontent.com/JHU-PL-Lab/jaylang/484b3876986a515fb57b11768a1b3b50418cde0c/benchmark/cases/mochi_origin/fpice/inductive6-3.ml | ocaml | let f g x =
if x > 0 then
g x
else
1
let decr x = x - 1
let main n = if n >= 3 || n <= 0 then assert(f decr n > 0) else ()
| |
a26f21a7d984e60fd54b984d8e219b2b5c197c2228e9ff72d90aad43df2615b4 | BranchTaken/Hemlock | test_push_back.ml | open! Basis.Rudiments
open! Basis
open Q
let test () =
let rec fn i n t = begin
match i <= n with
| false -> ()
| true -> begin
let t' = push_back i t in
File.Fmt.stdout
|> Fmt.fmt "push_back "
|> Uns.pp i
|> Fmt.fmt " "
|> (pp Uns.pp) t
|> Fmt.fmt ... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/f3604ceda4f75cf18b6ee2b1c2f3c5759ad495a5/bootstrap/test/basis/q/test_push_back.ml | ocaml | open! Basis.Rudiments
open! Basis
open Q
let test () =
let rec fn i n t = begin
match i <= n with
| false -> ()
| true -> begin
let t' = push_back i t in
File.Fmt.stdout
|> Fmt.fmt "push_back "
|> Uns.pp i
|> Fmt.fmt " "
|> (pp Uns.pp) t
|> Fmt.fmt ... | |
af919d9987a87c4e1de8900095c895fc975b85dec1243fb68a471dc1cf0cdb5c | babashka/cli | changelog.clj | #!/usr/bin/env bb
(ns changelog
(:require [clojure.string :as str]))
(let [changelog (slurp "CHANGELOG.md")
replaced (str/replace changelog
#" #(\d+)"
(fn [[_ issue after]]
(format " [#%s]()%s"
... | null | https://raw.githubusercontent.com/babashka/cli/2bc8a0be083dfc3d4412ae5bab89e0424b7a7cd0/script/changelog.clj | clojure | #!/usr/bin/env bb
(ns changelog
(:require [clojure.string :as str]))
(let [changelog (slurp "CHANGELOG.md")
replaced (str/replace changelog
#" #(\d+)"
(fn [[_ issue after]]
(format " [#%s]()%s"
... | |
307b09a9d9d1a3aa4494c1e834a6fa29861e10d499d534a0dc9ce2dd5e3afa21 | jlesquembre/clj-nix | flake_test.clj | (ns integration.flake-test
(:require
[clojure.test :refer [deftest is testing use-fixtures]]
[babashka.fs :as fs]
[clojure.string :as string]
[clojure.java.shell :refer [sh] :as shell]))
#_
(def cljnix-dir (str (fs/cwd)))
#_
(deftest nix-build-test
(testing "nix build .#clj-builder"
(is (= 0
... | null | https://raw.githubusercontent.com/jlesquembre/clj-nix/38cbd2f6dd3a9bdc7c06b6f065da4e93cfa99e44/test/integration/flake_test.clj | clojure | TODO Move | (ns integration.flake-test
(:require
[clojure.test :refer [deftest is testing use-fixtures]]
[babashka.fs :as fs]
[clojure.string :as string]
[clojure.java.shell :refer [sh] :as shell]))
#_
(def cljnix-dir (str (fs/cwd)))
#_
(deftest nix-build-test
(testing "nix build .#clj-builder"
(is (= 0
... |
d8afbc9cc8cb02c6d15ca4d6ad1beb8135ffe0151de8c7fc88e0fd81e3e548a8 | typelead/etlas | GenericPackageDescription.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
module Distribution.Types.GenericPackageDescription (
GenericPackageDescription(..),
Flag(..),
emptyFlag,
FlagName,
mkFlagName,
unFlagName,
FlagAssignment,
showFlagValue,
dispFlagAssignment,
parseFlagAssignment,
... | null | https://raw.githubusercontent.com/typelead/etlas/bbd7c558169e1fda086e759e1a6f8c8ca2807583/etlas-cabal/Distribution/Types/GenericPackageDescription.hs | haskell | # LANGUAGE DeriveDataTypeable #
---------------------------------------------------------------------------
The GenericPackageDescription type
| A flag can represent a feature to be included, or a way of linking
a target against its dependencies, or in fact whatever you can think of.
| A 'Flag' initialized with ... | # LANGUAGE DeriveGeneric #
module Distribution.Types.GenericPackageDescription (
GenericPackageDescription(..),
Flag(..),
emptyFlag,
FlagName,
mkFlagName,
unFlagName,
FlagAssignment,
showFlagValue,
dispFlagAssignment,
parseFlagAssignment,
ConfVar(..),
) where
import Prelude... |
112b5139f383ee6f6f69028e1bab0fab63f13bf286f74f2c337016c23a573642 | uvm-plaid/duet | Pretty.hs | module Duet.Pretty where
import UVMHS
import Duet.Syntax
import Duet.Quantity
instance (Pretty e) ⇒ Pretty (Quantity e) where
pretty Zero = ppKeyPun "⊥"
pretty (Quantity e) = pretty e
pretty Inf = ppKeyPun "⊤"
instance (Pretty r) ⇒ Pretty (RowsT r) where
pretty = \case
RexpRT r → pretty r
StarRT → p... | null | https://raw.githubusercontent.com/uvm-plaid/duet/ddfddc07176f3af208f3c93967ee7f4deefb4770/src/Duet/Pretty.hs | haskell | module Duet.Pretty where
import UVMHS
import Duet.Syntax
import Duet.Quantity
instance (Pretty e) ⇒ Pretty (Quantity e) where
pretty Zero = ppKeyPun "⊥"
pretty (Quantity e) = pretty e
pretty Inf = ppKeyPun "⊤"
instance (Pretty r) ⇒ Pretty (RowsT r) where
pretty = \case
RexpRT r → pretty r
StarRT → p... | |
1fd054004571ee4159919cce3ddb2577531ac34de1ec7bd7304b7bafdab1a83d | rm-hull/big-bang | components.cljs | (ns big-bang.components
(:require-macros
[cljs.core.async.macros :refer [go]]
[dommy.macros :refer [node]])
(:require
[cljs.core.async :refer [>!]]
[dommy.core :refer [set-html!]]
[big-bang.core :refer [big-bang]]
[big-bang.events.browser :refer [target]]
[big-bang.package :refer [make-p... | null | https://raw.githubusercontent.com/rm-hull/big-bang/2825e7f0bb7615e1158a72d58f426bc1e33bd9ef/src/big_bang/components.cljs | clojure | (ns big-bang.components
(:require-macros
[cljs.core.async.macros :refer [go]]
[dommy.macros :refer [node]])
(:require
[cljs.core.async :refer [>!]]
[dommy.core :refer [set-html!]]
[big-bang.core :refer [big-bang]]
[big-bang.events.browser :refer [target]]
[big-bang.package :refer [make-p... | |
5cc661d2e4d5e48266bf6efedbdf83d4798c729d90c26a5a8b67d799f6c760f0 | joneshf/open-source | Server.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
|
Module : . Item . Server
Description : Metadata about the server this package is running on .
Copyright : ( c ) , 2017
License : BSD3
Mainta... | null | https://raw.githubusercontent.com/joneshf/open-source/e3412fc68c654d89a8d3af4e12ac19c70e3055ec/packages/rollbar-hs/src/Rollbar/Item/Server.hs | haskell | # LANGUAGE OverloadedStrings #
| Information about the server using this package.
^ The hostname of the server.
^ The root directory the server is running in.
^ The checked out branch the server is running on.
^ The version of the server.
| The root directory.
| The git branch the server is running on. | # LANGUAGE DeriveGeneric #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE NamedFieldPuns #
|
Module : . Item . Server
Description : Metadata about the server this package is running on .
Copyright : ( c ) , 2017
License : BSD3
Maintainer :
Stability : expe... |
c27ddfa9f4cf09914537ef62dcd83c6ffa83a0082e55a387bdaa3514e33f5e84 | Feldspar/raw-feldspar | Tut4_MemoryManagement.hs | module Tut4_MemoryManagement where
-- This file demonstrates how to control memory usage when writing vector code.
-- For a more realistic example of managed storage, see the example file
-- examples/FFT.hs.
-- For more detailed information on double-buffered storage, see the
-- documentation:
-- <-feldspar/docs/Fel... | null | https://raw.githubusercontent.com/Feldspar/raw-feldspar/d57ad4eae1624f9a2907d06e885a86a3f939072c/examples/Tut4_MemoryManagement.hs | haskell | This file demonstrates how to control memory usage when writing vector code.
For a more realistic example of managed storage, see the example file
examples/FFT.hs.
For more detailed information on double-buffered storage, see the
documentation:
<-feldspar/docs/Feldspar-Data-Buffered.html>
Some of the examples sh... | module Tut4_MemoryManagement where
import Prelude ()
import Feldspar.Run
import Feldspar.Data.Vector
import Feldspar.Data.Buffered
import Tut3_Vectors (quirk)
cases , one typically wants to allocate a small number of arrays and use
buildQuirk_safe :: Data Word32 -> Run (DManifest Word32)
buildQuirk_safe ... |
a7a556dee0fe2f12fffcc39097215848dd2c2f8b73df4013d82065f32e6b5e79 | cnuernber/dtype-next | expose_fn.clj | (ns tech.v3.datatype.expose-fn
(:require [tech.v3.datatype :as dtype]
[tech.v3.datatype.native-buffer :as native-buffer])
(:import [tech.v3.datatype.ffi Pointer]))
(defn add-two-nums
[num-a num-b]
(+ num-a num-b))
(defn allocate-buffer
[len]
;;setup buffer to be manually freed.
(when-not (... | null | https://raw.githubusercontent.com/cnuernber/dtype-next/8fb3166a44a2ce21a673c864ae4d0351b6813d46/native_test/tech/v3/datatype/expose_fn.clj | clojure | setup buffer to be manually freed. | (ns tech.v3.datatype.expose-fn
(:require [tech.v3.datatype :as dtype]
[tech.v3.datatype.native-buffer :as native-buffer])
(:import [tech.v3.datatype.ffi Pointer]))
(defn add-two-nums
[num-a num-b]
(+ num-a num-b))
(defn allocate-buffer
[len]
(when-not (== 0 len)
(dtype/make-container :na... |
8acf61747915ab80e950e1dd814ab70604b4730034272f39e426435ba208fc1e | weavejester/medley | core_test.cljc | (ns medley.core-test
#?(:clj (:import [clojure.lang ArityException]))
(:require #?(:clj [clojure.test :refer :all]
:cljs [cljs.test :refer-macros [deftest is testing]])
[medley.core :as m]))
(deftest test-find-first
(testing "sequences"
(is (= (m/find-first even? [7 3 3 2 8]) 2))
... | null | https://raw.githubusercontent.com/weavejester/medley/68b45f40658020dadb2485e2bb1aef55218e35b1/test/medley/core_test.cljc | clojure | (ns medley.core-test
#?(:clj (:import [clojure.lang ArityException]))
(:require #?(:clj [clojure.test :refer :all]
:cljs [cljs.test :refer-macros [deftest is testing]])
[medley.core :as m]))
(deftest test-find-first
(testing "sequences"
(is (= (m/find-first even? [7 3 3 2 8]) 2))
... | |
5a1654f7ffd7d420b1fa5e7bba1b876dac07181e701c5d015d406ce3240ba3f0 | appleshan/cl-http | cl-http-70-139.lisp | -*- Mode : lisp ; Syntax : common - lisp ; Package : user ; Base : 10 ; Patch - File : t -*-
Patch file for CL - HTTP version 70.139
;;; Reason: Function (CLOS:METHOD URL:COPY-MODE (URL::OBJECT-MIXIN)): handle variant extensions correctly
;;; Function HTTP::%WITH-HEADER-SET-INDEX: -
;;; Function HTTP::%GET-HEADER... | null | https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/lispm/server/patch/cl-http-70/cl-http-70-139.lisp | lisp | Syntax : common - lisp ; Package : user ; Base : 10 ; Patch - File : t -*-
Reason: Function (CLOS:METHOD URL:COPY-MODE (URL::OBJECT-MIXIN)): handle variant extensions correctly
Function HTTP::%WITH-HEADER-SET-INDEX: -
Function HTTP::%GET-HEADER-OBJECT: -
Function HTTP::WITH-HEADER-VALUES: -
Function (CLOS:MET... | Patch file for CL - HTTP version 70.139
Function ( CLOS : METHOD HTTP::SNAPSHOT - LOG - ENTRY ( HTTP::NOTIFICATION - LOG - FORMAT - MIXIN HTTP::SERVER - LOGGING - MIXIN ) ): -
Function ( CLOS : METHOD HTTP::SNAPSHOT - LOG - NOTIFICATION ( HTTP::ASYNCHRONOUS - LOG - NOTIFICATION - MIXIN HTTP::SERVER - LOGGING - ... |
6b5e6e05435052d9ce0923da34685b2c498312149cccf0dc3bb0aedeb93640a6 | sky-big/RabbitMQ | array.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2007 - 2011 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Publi... | null | https://raw.githubusercontent.com/sky-big/RabbitMQ/d7a773e11f93fcde4497c764c9fa185aad049ce2/erlang_otp_data_struct/array.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitatio... | Copyright Ericsson AB 2007 - 2011 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
@author < >
@author < >
Arrays... |
6394faee2a96c3571e7775ad3877e8139a05fe6cdc3bc27f1b2d1fbf92e5906c | serokell/universum | UtfProps.hs | # LANGUAGE CPP #
# LANGUAGE TypeFamilies #
module Test.Universum.UtfProps
( hprop_StringToBytes
, hprop_TextToBytes
, hprop_BytesTo
) where
import Universum
import Hedgehog (Gen, MonadGen, Property, assert, forAll, property)
#if MIN_VERSION_hedgehog(1,0,0)
import Hedgehog (GenBase)
#endif
import q... | null | https://raw.githubusercontent.com/serokell/universum/0ee8f07e7200fd35fe6be2abbe50e96f7f5acc6e/test/Test/Universum/UtfProps.hs | haskell | # LANGUAGE CPP #
# LANGUAGE TypeFamilies #
module Test.Universum.UtfProps
( hprop_StringToBytes
, hprop_TextToBytes
, hprop_BytesTo
) where
import Universum
import Hedgehog (Gen, MonadGen, Property, assert, forAll, property)
#if MIN_VERSION_hedgehog(1,0,0)
import Hedgehog (GenBase)
#endif
import q... | |
b0b724e1ccf82bdc5fc7ead96517ce686d57ba4863d2d98824854ba3a668eb6c | sbcl/sbcl | shebang.lisp | ;;;; cold-boot-only readmacro syntax
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and ... | null | https://raw.githubusercontent.com/sbcl/sbcl/fc686aef1c38ac4cea1897f545a06c339f67eca9/src/cold/shebang.lisp | lisp | cold-boot-only readmacro syntax
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
for SB-XC:*FEATURES* instead of CL:*FEATURES*. (This is handy
when cross-compiling, so that we can make a dis... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-COLD")
definition of # + and # - as a mechanism analogous to # + /#- , but
SBCL . )
(unless (find-pack... |
66cd1e3e538e0f0ee2f1d621ada4024b34ff371ca540be8e9a6ce4bcb4451c63 | mklinik/hmud | Util.hs | module Xmpp.Util where
import qualified Network.XMPP as XMPP
import Data.List (isPrefixOf)
import Hmud.Util
jid2player :: String -> String
jid2player jid = unwords $ map capitalize $ wordsPunct $ if "gtf@conference" `isPrefixOf` jid
then (XMPP.getResource jid)
else (XMPP.getUsername jid)
-- /jid/ must be a priv... | null | https://raw.githubusercontent.com/mklinik/hmud/5ba32f29170a098e007d50688df32cf8919b6bf1/Xmpp/Util.hs | haskell | /jid/ must be a private jabber ID, not the groupchat ID
jid2primKey must turn a jabber ID into a primary key for the player's
character. We use the jabber ID without resource, in order for players to
control their character from different jabber clients. | module Xmpp.Util where
import qualified Network.XMPP as XMPP
import Data.List (isPrefixOf)
import Hmud.Util
jid2player :: String -> String
jid2player jid = unwords $ map capitalize $ wordsPunct $ if "gtf@conference" `isPrefixOf` jid
then (XMPP.getResource jid)
else (XMPP.getUsername jid)
jid2primKey :: String -... |
a7ba927d34f88a4da956f78b8df559dfe73997504ae2780f548b5ae801460054 | opencog/learn | shape-project.scm | ;
; shape-project.scm
;
; Merge connectors based on linear shape merges.
;
Copyright ( c ) 2021 Linas Vepstas
;
; ---------------------------------------------------------------------
; OVERVIEW
; --------
; The creation of clusters is done via a "linear" projective merge of
; vectors that encode Sections. See top of... | null | https://raw.githubusercontent.com/opencog/learn/b3f2bc8260bdea5f2ba64dab7a20e265d23a14c3/scm/gram-class/shape-project.scm | scheme |
shape-project.scm
Merge connectors based on linear shape merges.
---------------------------------------------------------------------
OVERVIEW
--------
The creation of clusters is done via a "linear" projective merge of
vectors that encode Sections. See top of `gram-classification.scm` for
an overview of t... | Copyright ( c ) 2021 Linas Vepstas
Recall that the " germ " of a Section is the first element of the
section , the " vertex " . The rest of the Section is a ConnectorSeq .
Linear ( projective ) merging refers to the idea that , to merge two
vectors , one need only merge their germs into a common class
and i... |
218035becea4ddd82a5914a60d948882f7461ce09062ecc08bb0fa0ae09c71b9 | nonguix/nonguix | chrome.scm | SPDX - License - Identifier : GPL-3.0 - or - later
Copyright © 2022 < >
Copyright © 2022 >
Copyright © 2022 < >
(define-module (nongnu packages chrome)
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
#:use-module (gnu packages curl)
#:use-module (gnu packages cups)
... | null | https://raw.githubusercontent.com/nonguix/nonguix/225185a1bd6b73852d941c469d9689da0ac89426/nongnu/packages/chrome.scm | scheme | Many thanks to
This allows us to override CHROME_WRAPPER later. | SPDX - License - Identifier : GPL-3.0 - or - later
Copyright © 2022 < >
Copyright © 2022 >
Copyright © 2022 < >
(define-module (nongnu packages chrome)
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
#:use-module (gnu packages curl)
#:use-module (gnu packages cups)
... |
5cf4ee9d691e0798f98253793c779e280b1dbd55b09dc2c0bb2d8a87a09677a8 | evincarofautumn/kitten | Infix.hs | |
Module : Kitten . . Infix
Description : Desugaring infix operators to postfix
Copyright : ( c ) , 2016
License : MIT
Maintainer :
Stability : experimental
Portability : GHC
Module : Kitten.Desugar.Infix
Description : Desugaring infix operators to postfix
Copyright : (c) J... | null | https://raw.githubusercontent.com/evincarofautumn/kitten/a5301fe24dbb9ea91974abee73ad544156ee4722/lib/Kitten/Desugar/Infix.hs | haskell | # LANGUAGE OverloadedStrings #
according to the definitions and operator metadata in the 'Dictionary'. | |
Module : Kitten . . Infix
Description : Desugaring infix operators to postfix
Copyright : ( c ) , 2016
License : MIT
Maintainer :
Stability : experimental
Portability : GHC
Module : Kitten.Desugar.Infix
Description : Desugaring infix operators to postfix
Copyright : (c) J... |
3ceb5d7d3b3db3ff4fc3a5ae4b820359f92e6e652ef20cc509f157c183439617 | GaloisInc/msf-haskell | Job.hs | |Various functions for controlling and interacting with running MSF
-- jobs.
module MSF.Job
( module Types.Job
, job_list
, job_info
, job_stop
, job_list_name_substring
, job_list_name_substring2
, job_extended_list
) where
import MSF.Monad
import Types.Job
import qualified RPC.Job as RPC
import qu... | null | https://raw.githubusercontent.com/GaloisInc/msf-haskell/76cee10771f9e9d10aa3301198e09f08bde907be/src/MSF/Job.hs | haskell | jobs.
| Get a list of the running jobs.
| Stop a given job. Quiet action. Can presumably impact target.
---------------------------------------------------------------------------
|Search for the jobs matching the given substring and return
extended information.
|Search for the jobs matching the given substring a... | |Various functions for controlling and interacting with running MSF
module MSF.Job
( module Types.Job
, job_list
, job_info
, job_stop
, job_list_name_substring
, job_list_name_substring2
, job_extended_list
) where
import MSF.Monad
import Types.Job
import qualified RPC.Job as RPC
import qualified D... |
b9f37845271ad5ea634769ea799e2cc5f166bb12e290b2a7ae6e504559432cdf | spurious/chibi-scheme-mirror | record-tests.scm |
(cond-expand
(modules
(import (srfi 99)
(only (chibi) env-exports)
(only (chibi test) test-begin test-assert test test-end)))
(else #f))
(test-begin "records")
(define-record-type organism
(make-organism name)
organism?
(name name-of set-name-of!))
;; kingdom
(define-record-type (anima... | null | https://raw.githubusercontent.com/spurious/chibi-scheme-mirror/49168ab073f64a95c834b5f584a9aaea3469594d/tests/record-tests.scm | scheme | kingdom
all animals eat
phylum
class
all mammals have nipples
order
family
genus
species
SRFI-99 forbids this, but we currently do it anyway.
(define-record-type foo
(make-foo x)
foo?
(x foo-x))
(test-assert (not (rtd-field-mutable? foo 'x)))
Name conflicts - make sure we rename
record types d... |
(cond-expand
(modules
(import (srfi 99)
(only (chibi) env-exports)
(only (chibi test) test-begin test-assert test test-end)))
(else #f))
(test-begin "records")
(define-record-type organism
(make-organism name)
organism?
(name name-of set-name-of!))
(define-record-type (animal organism)... |
800c9489bba4140d4a9edcdadd81efd14dd22d58b983c1f5fe8e89ad0b782ca9 | passy/coding-puzzles | Main.hs | import Control.Applicative ((<$>))
import Data.List
import Control.Monad
import Debug.Trace
import qualified Data.Set as Set
import qualified Data.Map.Strict as M
readListOfInts :: IO [Int]
readListOfInts = fmap read <$> words <$> getLine
findMissing :: [Int] -> [Int] -> [Int]
findMissing lm ln =
let indexed = zip ... | null | https://raw.githubusercontent.com/passy/coding-puzzles/686bd0775ee5a98004229d44c913376d033b13de/hackerrank/missing-numbers-fp/Main.hs | haskell | import Control.Applicative ((<$>))
import Data.List
import Control.Monad
import Debug.Trace
import qualified Data.Set as Set
import qualified Data.Map.Strict as M
readListOfInts :: IO [Int]
readListOfInts = fmap read <$> words <$> getLine
findMissing :: [Int] -> [Int] -> [Int]
findMissing lm ln =
let indexed = zip ... | |
394b9624807f4ef58614791fbeab775d678ef26c553f19f1ed267dcc2c372e6e | askvortsov1/nittany_market | zipcodeinfo.mli | module ZipcodeInfo : sig
type t = {
zipcode : string;
city : string;
state_id : string;
population : int option;
density : float option;
county_name : string;
timezone : string;
}
type key = string
type fields = (string * string * string * int option) * (float option * string * stri... | null | https://raw.githubusercontent.com/askvortsov1/nittany_market/08ffcad2bb2ead9aaeb85b22b88aa2af879e36ad/lib/models/zipcodeinfo.mli | ocaml | module ZipcodeInfo : sig
type t = {
zipcode : string;
city : string;
state_id : string;
population : int option;
density : float option;
county_name : string;
timezone : string;
}
type key = string
type fields = (string * string * string * int option) * (float option * string * stri... | |
e083d42b45036c0c356e20c42db0a4cf214b7eb11db9b34b9efd1b500744e75f | spilgames/erl-cache | erl_cache_eunit.erl | -module(erl_cache_eunit).
-include_lib("eunit/include/eunit.hrl").
-include("erl_cache.hrl").
-include_lib("decorator_pt/include/decorator_pt.hrl").
-behaviour(erl_cache_key_generator).
-export([generate_key/4]).
-ifdef(TEST).
-export([is_error/1]).
-endif.
-define(TEST_CACHE, s1).
-define(TEST_CACHE2, s2).
setup... | null | https://raw.githubusercontent.com/spilgames/erl-cache/279f120fbb255e390fdabd88d816e379f4b6b9b9/test/erl_cache_eunit.erl | erlang | Test Sets
This get should hit the value in overdue and shouldn't refresh it
At this point the value should have been evicted
This get should hit the value in overdue and refresh it
The value should have been asynchronously refreshed
At this point the value should have been evicted
This get should hit the value i... | -module(erl_cache_eunit).
-include_lib("eunit/include/eunit.hrl").
-include("erl_cache.hrl").
-include_lib("decorator_pt/include/decorator_pt.hrl").
-behaviour(erl_cache_key_generator).
-export([generate_key/4]).
-ifdef(TEST).
-export([is_error/1]).
-endif.
-define(TEST_CACHE, s1).
-define(TEST_CACHE2, s2).
setup... |
5794525a048b516d6f1a32d06a8d8ab6281a635e92ad317d066ebb3b584028cf | simongray/sino.study | pages.cljc | (ns sinostudy.spec.pages
(:require [clojure.spec.alpha :as s]))
(s/def ::category
#{:term :static})
(s/def ::page
(s/tuple ::category string?))
| null | https://raw.githubusercontent.com/simongray/sino.study/b1b2954011841bc96449a1aa61eb51656930aee5/src/sinostudy/spec/pages.cljc | clojure | (ns sinostudy.spec.pages
(:require [clojure.spec.alpha :as s]))
(s/def ::category
#{:term :static})
(s/def ::page
(s/tuple ::category string?))
| |
e0a050273b3a60acf60a85e68bf55f075135bb55b5d7e01dff732b64b7a77381 | modular-macros/ocaml-macros | a.ml | let x = ref 0
let u = Random.int 1000
let () =
Printf.printf "A is running (%i)\n%!" u
| null | https://raw.githubusercontent.com/modular-macros/ocaml-macros/05372c7248b5a7b1aa507b3c581f710380f17fcd/testsuite/tests/lib-dynlink-native/a.ml | ocaml | let x = ref 0
let u = Random.int 1000
let () =
Printf.printf "A is running (%i)\n%!" u
| |
0873c73b023fb26083058d6e6bd7a27117d10f4f920acb05ddeecfa77926f88f | evertedsphere/noether | Neutral.hs | # LANGUAGE TypeApplications #
module Noether.Algebra.Single.Neutral where
import qualified Prelude as P
import Noether.Lemmata.Prelude hiding (Num)
import Noether.Lemmata.TypeFu
import Noether.Algebra.Tags
data NeutralE
= NeutralPrim
| NeutralNum
| NeutralNamed Sy... | null | https://raw.githubusercontent.com/evertedsphere/noether/c4223f64b9df5b0dbbeec1fea726bfff7f5810f5/library/Noether/Algebra/Single/Neutral.hs | haskell | # LANGUAGE TypeApplications #
module Noether.Algebra.Single.Neutral where
import qualified Prelude as P
import Noether.Lemmata.Prelude hiding (Num)
import Noether.Lemmata.TypeFu
import Noether.Algebra.Tags
data NeutralE
= NeutralPrim
| NeutralNum
| NeutralNamed Sy... | |
0185a3744713ef156832d57531253d01ffef8a96fd317372bb244bde5e0a485d | input-output-hk/cardano-ledger | TxOut.hs | # LANGUAGE DataKinds #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wno - orphans #
module Cardano.Ledger.C... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/e0947b0c2e99ef929d20593be03e199560392f42/eras/conway/impl/src/Cardano/Ledger/Conway/TxOut.hs | haskell | # LANGUAGE RankNTypes #
# SPECIALIZE instance AlonzoEraTxOut (ConwayEra CC.StandardCrypto) #
# INLINE referenceScriptTxOutL # | # LANGUAGE DataKinds #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wno - orphans #
module Cardano.Ledger.Conway.TxOut (
module Babba... |
b15722394fde0159e01591a616394d1a9e1d097407e042c99137f31aeedd4876 | SanderSpies/ocaml-gist | mtyper.ml | open Std
type ('p,'t) item = {
parsetree_item: 'p;
typedtree_items: 't list * Types.signature_item list;
part_snapshot: Btype.snapshot;
part_env : Env.t;
part_errors : exn list;
part_checks : ((unit -> unit) * Warnings.state) list;
}
(* type typedtree = [
| `Interface of Typedtree.signature
| `I... | null | https://raw.githubusercontent.com/SanderSpies/ocaml-gist/7dc229aebdf51310e8c7dae12df0cb55b5de5a32/ocaml_webworker/merlin_lite/src/kernel/mtyper.ml | ocaml | type typedtree = [
| `Interface of Typedtree.signature
| `Implementation of Typedtree.structure
]
If recovery happens, the incorrect node is kept and a recovery node
is introduced, so the node to check for recovery is the second one. | open Std
type ('p,'t) item = {
parsetree_item: 'p;
typedtree_items: 't list * Types.signature_item list;
part_snapshot: Btype.snapshot;
part_env : Env.t;
part_errors : exn list;
part_checks : ((unit -> unit) * Warnings.state) list;
}
type result = {
config : Mconfig.t;
state : Local_stor... |
a5a0c5bd459095951f7869f08b69144361c4fcc0e3100ccbd5649b7215dc28a1 | yoriyuki/Camomile | hangul.ml | (** Hangul *)
Copyright ( C ) 2003 .
(* 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 2 of
the License , or ( at your option ) any later version .
As a sp... | null | https://raw.githubusercontent.com/yoriyuki/Camomile/d7d8843c88fae774f513610f8e09a613778e64b3/Camomile/internal/hangul.ml | ocaml | * Hangul
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
may link, statically or dynamically, a "work that uses this library"
with a publicly distributed version of this library to produce an
executable file containing portions o... | Copyright ( C ) 2003 .
as published by the Free Software Foundation ; either version 2 of
the License , or ( at your option ) any later version .
As a special exception to the GNU Library General Public License , you
additional requirements listed in clause 6 of the GNU Library General
we mean either th... |
983bc4144488d009bcd051cbe0ae8b4ec7af9f4216cbd33f645835612c88ed5d | jlouis/curve_tun | curve_tun_connection.erl | -module(curve_tun_connection).
-behaviour(gen_fsm).
-export([connect/3, accept/1, accept/2, listen/2, send/2, close/1, recv/1, recv/2, controlling_process/2]).
%% Private callbacks
-export([start_fsm/0, start_link/1]).
FSM callbacks
-export([init/1, code_change/4, terminate/3, handle_info/3, handle_event/3, handle... | null | https://raw.githubusercontent.com/jlouis/curve_tun/7da3377bd5bada76b6e3ba719d1691c92eaccdf6/src/curve_tun_connection.erl | erlang | Private callbacks
I don't expect code to ever hit this limit. As an example, you exhaust this in
connection.
INTERNAL HANDLERS
@doc process_recv_queue/1 sends messages back to waiting receivers
Analyze the current waiting receivers and the buffer state. If there is a receiver for the buffered
message, then send ... | -module(curve_tun_connection).
-behaviour(gen_fsm).
-export([connect/3, accept/1, accept/2, listen/2, send/2, close/1, recv/1, recv/2, controlling_process/2]).
-export([start_fsm/0, start_link/1]).
FSM callbacks
-export([init/1, code_change/4, terminate/3, handle_info/3, handle_event/3, handle_sync_event/4]).
-ex... |
5f2698922ce4f0c319d456df0eb94b538a299212662a42cde0dd59f0486e3d85 | matterhorn-chat/mattermost-api | Util.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE GeneralizedNewtypeDeriving #
module Network.Mattermost.Util
( ConnectionType(..)
, assertE
, noteE
, hoistE
, (~=)
, withConnection
, mkConnection
, connectionGetExact
, buildPath
) where
import Control.Exception (finally, onException)
import Data.Char... | null | https://raw.githubusercontent.com/matterhorn-chat/mattermost-api/cd337d5129930e82401e4eaed1c7fa03eb2bc62c/src/Network/Mattermost/Util.hs | haskell | # LANGUAGE OverloadedStrings #
| This unwraps a 'Maybe' value, throwing a provided exception
if the value is 'Nothing'.
| This unwraps an 'Either' value, throwing the contained exception
if the 'Either' was a 'Left' value.
| This asserts that the provided 'Bool' is 'True', throwing a
provided exception is t... | # LANGUAGE GeneralizedNewtypeDeriving #
module Network.Mattermost.Util
( ConnectionType(..)
, assertE
, noteE
, hoistE
, (~=)
, withConnection
, mkConnection
, connectionGetExact
, buildPath
) where
import Control.Exception (finally, onException)
import Data.Char ( toUpper )
import qualified Data.... |
04f4b5d348884b690c5ab7fd83e17052f1774b7e0b40fc32afe29911c63dd6e0 | effectfully/tiny-lang | TestUtils.hs | module Field.TestUtils
( testFiles
, goldenFile
, parseRational
, parseFilePath
, discoverTests
, typeCheckFilePath
) where
import TinyLang.Prelude
import TinyLang.Field.Raw.Core (RawProgram)
import TinyLang.Field.Raw.Parser
import TinyLang.Field... | null | https://raw.githubusercontent.com/effectfully/tiny-lang/3dbb730d3595a76f087a33da3b353783ff2a27e9/test/Field/TestUtils.hs | haskell | module Field.TestUtils
( testFiles
, goldenFile
, parseRational
, parseFilePath
, discoverTests
, typeCheckFilePath
) where
import TinyLang.Prelude
import TinyLang.Field.Raw.Core (RawProgram)
import TinyLang.Field.Raw.Parser
import TinyLang.Field... | |
957c957fbd3893832f6efb4877f42c621ac10d5cdfd219e570150b0e6ad7e656 | onaio/vega-viewer | macros.clj | (ns vega-viewer.macros)
(defmacro read-file
"Takes a filename, and returns contents as string, at compile time. Used for
ClojureScript tests to read fixtures."
[filename]
(slurp filename))
| null | https://raw.githubusercontent.com/onaio/vega-viewer/591c310131d2b662d96aef21546a718fcc0752a8/test/vega_viewer/macros.clj | clojure | (ns vega-viewer.macros)
(defmacro read-file
"Takes a filename, and returns contents as string, at compile time. Used for
ClojureScript tests to read fixtures."
[filename]
(slurp filename))
| |
ec23c19df5b07a191e9eb14438788482d70d2fd9d74b377de2c0b3278946db9b | reflex-frp/reflex | AppendMap.hs | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternSynonyms #
# LANGUAGE RoleAnnotations #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -fno - warn - orphans #
-- |
-- Module:
Data .
-- Description:
-- Ins... | null | https://raw.githubusercontent.com/reflex-frp/reflex/04e43cda2e113eb9df5df5d13613a7b6744fd14f/src/Data/AppendMap.hs | haskell | |
Module:
Description:
Instances and convenience functions for 'Data.Map.Monoidal'. We use
monoidal-containers to take advantage of its better monoid instance.
has @mappend = unionWith mappend@ instead.
| A synonym for 'getMonoidalMap'
| Deletes a key, returning 'Nothing' if the result is empty.
| Like '... | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternSynonyms #
# LANGUAGE RoleAnnotations #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -fno - warn - orphans #
Data .
' Data . Map ' has @mappend = union@... |
0b8fa654675d2fd28a32393dd2b02f0db8f841d652b43bfd47b48e98c5c14120 | returntocorp/semgrep | Visit_function_defs.ml | Iago Abal
*
* Copyright ( C ) 2022 r2c
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file lic... | null | https://raw.githubusercontent.com/returntocorp/semgrep/ca7f45cf2c45405eecac05e087f84542b6256395/src/analyzing/Visit_function_defs.ml | ocaml | go into nested functions
but do NOT revisit the function definition again
with `kfunction_definition` below!
go into nested functions
Visit all function definitions in an AST.
Check each function definition. | Iago Abal
*
* Copyright ( C ) 2022 r2c
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file lic... |
fc7bbe01d7044d4b8c60206a1e26c994d3c808ea08b42a5f6af45781c2513edf | nikita-volkov/vector-builder | Update.hs | module VectorBuilder.Core.Update where
import qualified Data.Vector.Generic as B
import qualified Data.Vector.Generic.Mutable as A
import VectorBuilder.Prelude
newtype Update element
= Update (forall s vector. A.MVector vector element => vector s element -> Int -> ST s ())
# INLINE write #
write :: element -> Upda... | null | https://raw.githubusercontent.com/nikita-volkov/vector-builder/83f733476ba99bccbbe1e832b668a3f07b639938/library/VectorBuilder/Core/Update.hs | haskell | # INLINE empty # | module VectorBuilder.Core.Update where
import qualified Data.Vector.Generic as B
import qualified Data.Vector.Generic.Mutable as A
import VectorBuilder.Prelude
newtype Update element
= Update (forall s vector. A.MVector vector element => vector s element -> Int -> ST s ())
# INLINE write #
write :: element -> Upda... |
c2ea46ab94b9ea4963b7a3172375d011a59b43b571cfc8e119c0d0f2cf94c6d5 | zero-one-group/geni | core.clj | (ns {{namespace}}.core
(:require
[clojure.pprint]
[zero-one.geni.core :as g]
[zero-one.geni.ml :as ml]
[zero-one.geni.repl :as repl])
(:gen-class))
Removes the pesky ns warning that takes up the first line of the REPL .
(require '[net.cgrand.parsley.fold])
{{! Change mustache delimiter to <% and... | null | https://raw.githubusercontent.com/zero-one-group/geni/4dbabf8315d85cc1526e04bca7e4cb7b75c21ac1/lein-template/resources/leiningen/new/geni/core.clj | clojure | (ns {{namespace}}.core
(:require
[clojure.pprint]
[zero-one.geni.core :as g]
[zero-one.geni.ml :as ml]
[zero-one.geni.repl :as repl])
(:gen-class))
Removes the pesky ns warning that takes up the first line of the REPL .
(require '[net.cgrand.parsley.fold])
{{! Change mustache delimiter to <% and... | |
151ffc4310fa91da4af19a353a063ee3eb34d6530645f0d2d954dfa0bf4fdde0 | BitGameEN/bitgamex | sample_ws_handler.erl | -module(sample_ws_handler).
-behaviour(websocket_client_handler).
-export([
start_link/0,
init/2,
websocket_handle/3,
websocket_info/3,
websocket_terminate/3
]).
start_link() ->
crypto:start(),
ssl:start(),
websocket_client:start_link("wss", ?MODULE, [... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/websocket_client/examples/sample_ws_handler.erl | erlang | -module(sample_ws_handler).
-behaviour(websocket_client_handler).
-export([
start_link/0,
init/2,
websocket_handle/3,
websocket_info/3,
websocket_terminate/3
]).
start_link() ->
crypto:start(),
ssl:start(),
websocket_client:start_link("wss", ?MODULE, [... | |
ab1090593912af2a3718b86e6b8d28079ef4cc76288378c87671a7743973c5d1 | anoma/juvix | Strip.hs | module Commands.Dev.Core.Strip where
import Commands.Base
import Commands.Dev.Core.Strip.Options
import Juvix.Compiler.Core.Pipeline qualified as Core
import Juvix.Compiler.Core.Pretty qualified as Core
import Juvix.Compiler.Core.Translation.FromSource qualified as Core
import Juvix.Compiler.Core.Translation.Stripped.... | null | https://raw.githubusercontent.com/anoma/juvix/efb7f2abd07792c80e401b330257df1c4be7f694/app/Commands/Dev/Core/Strip.hs | haskell | module Commands.Dev.Core.Strip where
import Commands.Base
import Commands.Dev.Core.Strip.Options
import Juvix.Compiler.Core.Pipeline qualified as Core
import Juvix.Compiler.Core.Pretty qualified as Core
import Juvix.Compiler.Core.Translation.FromSource qualified as Core
import Juvix.Compiler.Core.Translation.Stripped.... | |
55c948c791bc018bd762964f62cc9a928d6194f225c05b8df9ebc5cf38dec2f7 | chenyukang/eopl | 19.scm | Writea Scheme procedure tail - form ? that takes the syntax tree of a program in CPS - IN ,
expressed in the grammar of figure 6.3 , and determines whether the same string would
be in tail form according to the grammar of figure 6.5 .
TODO
| null | https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/ch6/19.scm | scheme | Writea Scheme procedure tail - form ? that takes the syntax tree of a program in CPS - IN ,
expressed in the grammar of figure 6.3 , and determines whether the same string would
be in tail form according to the grammar of figure 6.5 .
TODO
| |
9528f0fb98f3d50a003e842b4b8ef29411a7c4b48329bdec4fe92e9ad38b387d | webyrd/mediKanren | create-all-hashtables.rkt | #lang racket
(require
"create-hashtable-common.rkt"
"create-doid-cui-to-cid-hashtable.rkt"
"create-ensembl-cui-to-cid-hashtable.rkt"
"create-hgnc-cui-to-cid-hashtable.rkt"
"create-hpo-cui-to-cid-hashtable.rkt"
"create-mondo-cui-to-cid-hashtable.rkt"
"create-omim-cui-to-cid-hashtable.rkt"
"create-umls-c... | null | https://raw.githubusercontent.com/webyrd/mediKanren/f82c3c7eb0814eefbfff97f69ee9f73fb258d55c/attic/medikanren/create-all-hashtables.rkt | racket | #lang racket
(require
"create-hashtable-common.rkt"
"create-doid-cui-to-cid-hashtable.rkt"
"create-ensembl-cui-to-cid-hashtable.rkt"
"create-hgnc-cui-to-cid-hashtable.rkt"
"create-hpo-cui-to-cid-hashtable.rkt"
"create-mondo-cui-to-cid-hashtable.rkt"
"create-omim-cui-to-cid-hashtable.rkt"
"create-umls-c... | |
ade440ebb7651470f37dc4221590b09c67eac3f85d8623d1c67621f609d4d61c | clj-easy/graalvm-clojure | main.clj | (ns simple.main
(:require [clj-uuid :as uuid])
(:gen-class))
;;
;; Update this file to use the libary you wish to test.
;;
(defn -main []
(println (uuid/null))
(println (uuid/v0))
(println uuid/+null+)
(println (uuid/v1))
(println (uuid/get-timestamp (uuid/v1)))
(println (uuid/get-instant (uuid/v1)))... | null | https://raw.githubusercontent.com/clj-easy/graalvm-clojure/5de155ad4f95d5dac97aac1ab3d118400e7d186f/clj-uuid/src/simple/main.clj | clojure |
Update this file to use the libary you wish to test.
(println (uuid/v3 uuid/+namespace-url+ :keyword))
(println (uuid/v3 uuid/+null+ 'this-symbol))
(println (uuid/v5 uuid/+namespace-url+ :keyword))
(println (uuid/v5 uuid/+null+ 'this-symbol)) | (ns simple.main
(:require [clj-uuid :as uuid])
(:gen-class))
(defn -main []
(println (uuid/null))
(println (uuid/v0))
(println uuid/+null+)
(println (uuid/v1))
(println (uuid/get-timestamp (uuid/v1)))
(println (uuid/get-instant (uuid/v1)))
(println (uuid/v3 uuid/+namespace-dns+ "www.clojure.org"))
... |
7abde37bc94454def8a3d573a66a5b21fc4fd2b7cf9ae7fb5ef92178a6beeb11 | lachenmayer/arrowsmith | Expression.hs | # OPTIONS_GHC -Wall #
module Type.Constrain.Expression where
import Control.Applicative ((<$>))
import qualified Control.Monad as Monad
import Control.Monad.Error
import qualified Data.List as List
import qualified Data.Map as Map
import Prelude hiding (and)
import qualified Text.PrettyPrint as PP
import qualified AS... | null | https://raw.githubusercontent.com/lachenmayer/arrowsmith/34b6bdeddddb2d8b9c6f41002e87ec65ce8a701a/elm-compiler/src/Type/Constrain/Expression.hs | haskell | CONSTRAIN DEFINITIONS
should come from the def, but I'm not sure what would live there...
Some mistake may be happening here. Currently, qs is always [].
Some mistake may be happening here. Currently, qs is always []. | # OPTIONS_GHC -Wall #
module Type.Constrain.Expression where
import Control.Applicative ((<$>))
import qualified Control.Monad as Monad
import Control.Monad.Error
import qualified Data.List as List
import qualified Data.Map as Map
import Prelude hiding (and)
import qualified Text.PrettyPrint as PP
import qualified AS... |
6b9a2cf6f0c789bf33cb4f225e52caf58ccc41eb1aa9a598dc7c06eb3c2397af | gedge-platform/gedge-platform | jose_sha3_libdecaf.erl | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
%% vim: ts=4 sw=4 ft=erlang noet
%%%-------------------------------------------------------------------
@author < >
2014 - 2016 ,
%%% @doc
%%%
%%% @end
Created : 01 Mar 2016 by < >
%%%---------------------------... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/jose/src/jose_sha3_libdecaf.erl | erlang | vim: ts=4 sw=4 ft=erlang noet
-------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
jose_sha3 callbacks
====================================================================
jose_sha3 callbacks
=============================... | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
@author < >
2014 - 2016 ,
Created : 01 Mar 2016 by < >
-module(jose_sha3_libdecaf).
-behaviour(jose_sha3).
-export([sha3_224/1]).
-export([sha3_256/1]).
-export([sha3_384/1]).
-export([sha3_512/1]).
-export([s... |
db50530d3cb646518e2483a750f6a93b9a31efad5e3c6b5665f0c9a1ea0bc4dc | yogeshsajanikar/hspark | MapIOSpec.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE StaticPointers #
module MapIOSpec where
import Spark
import Data.List (sort)
import Control.Monad
import Control.Distributed.Process
import Control.Distributed.Static hiding (initRemoteTable)
import Control.Distributed.Process.Closure
import Control.Distributed.Process.No... | null | https://raw.githubusercontent.com/yogeshsajanikar/hspark/43e150ec38a62be3d14a7072787d1a8992f1841e/test/MapIOSpec.hs | haskell | # LANGUAGE TemplateHaskell #
# LANGUAGE StaticPointers #
module MapIOSpec where
import Spark
import Data.List (sort)
import Control.Monad
import Control.Distributed.Process
import Control.Distributed.Static hiding (initRemoteTable)
import Control.Distributed.Process.Closure
import Control.Distributed.Process.No... | |
9c67d3a8e56192d00d6bfc810be0c09ef4f667d29d0e1333d9194db3b6216197 | Idorobots/spartan | bootstrap.rkt | #lang racket
;; The bootstrap code.
(require "../compiler/utils/utils.rkt")
(require "../compiler/utils/refs.rkt")
(require "../rete/rete.rkt")
(require "continuations.rkt")
(require "delimited.rkt")
(require "closures.rkt")
(require "exceptions.rkt")
(require "actor.rkt")
(require "monitor.rkt")
(provide nil? notif... | null | https://raw.githubusercontent.com/Idorobots/spartan/ef3b032906655585d284f1c9a33a58f1e35cb180/src/runtime/bootstrap.rkt | racket | The bootstrap code.
Built-in functions
Continuations:
Exceptions:
Actor model:
If a message is received, return the message.
Else, setup a continuation that attempts to re-fetch the message.
Misc: | #lang racket
(require "../compiler/utils/utils.rkt")
(require "../compiler/utils/refs.rkt")
(require "../rete/rete.rkt")
(require "continuations.rkt")
(require "delimited.rkt")
(require "closures.rkt")
(require "exceptions.rkt")
(require "actor.rkt")
(require "monitor.rkt")
(provide nil? notify-whenever
__n... |
4792a7706da34fc32583dc0d129c9cfc8340f0d272b77d4de2f7cc589d96d725 | jonascarpay/apecs | Main.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE TemplateHaskell #-}
# LANGUAGE TypeApplications ... | null | https://raw.githubusercontent.com/jonascarpay/apecs/19c9dc15b31bfd4173230a327dec98e2aa959936/apecs/test/Main.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
Preamble
insert and delete random data
insert and delete random data
Tests whether writing and reading gives back the original component
Tests whether this is also true for caches
Tests basic tu... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -w #
import ... |
e49ab40da4844e830e95f2ffac5af93cbfd3d997b4b608169c749ef30dad512a | mirage/alcotest | alcotest_async.ml | open Async
open Async_unix
let run_test timeout name fn args =
Clock.with_timeout timeout (fn args) >>| function
| `Result x -> x
| `Timeout ->
Alcotest.fail
(Printf.sprintf "%s timed out after %s" name
(Time_unix.Span.to_string_hum timeout))
module Promise = struct
include Deferred
... | null | https://raw.githubusercontent.com/mirage/alcotest/3a34aa397364955f8e5c4518de86ebd7ff2d66c0/src/alcotest-async/alcotest_async.ml | ocaml | open Async
open Async_unix
let run_test timeout name fn args =
Clock.with_timeout timeout (fn args) >>| function
| `Result x -> x
| `Timeout ->
Alcotest.fail
(Printf.sprintf "%s timed out after %s" name
(Time_unix.Span.to_string_hum timeout))
module Promise = struct
include Deferred
... | |
cfcf146556b386f37f49c9bf484f7ed3daf06dfa31cdb8471d15405aad762fbf | cloudkj/lambda-ml | hierarchical_test.clj | (ns lambda-ml.clustering.hierarchical-test
(:require [clojure.test :refer :all]
[lambda-ml.clustering.hierarchical :refer :all]
[lambda-ml.distance :as d]))
(deftest test-pairwise-distances
(let [points [[1 1 1 0 1 0 0 1 1 1]
[1 1 0 1 1 0 0 0 0 1]
[0 1 1 0 1 ... | null | https://raw.githubusercontent.com/cloudkj/lambda-ml/a470a375d2b94f5e5e623a5e198ac312b018ffb3/test/lambda_ml/clustering/hierarchical_test.clj | clojure | (ns lambda-ml.clustering.hierarchical-test
(:require [clojure.test :refer :all]
[lambda-ml.clustering.hierarchical :refer :all]
[lambda-ml.distance :as d]))
(deftest test-pairwise-distances
(let [points [[1 1 1 0 1 0 0 1 1 1]
[1 1 0 1 1 0 0 0 0 1]
[0 1 1 0 1 ... | |
0692fba4a292389cfeacbd99ed6d6d25ff52dc328b41e950bf6396ecd58cc5e5 | aphyr/adaptive-executor | project.clj | (defproject adaptive-executor "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[net.mikera/core.matrix "0.17.0"]])
| null | https://raw.githubusercontent.com/aphyr/adaptive-executor/193c3f28441f9e6c72d627a0ab0240f4aaec9d7d/project.clj | clojure | (defproject adaptive-executor "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[net.mikera/core.matrix "0.17.0"]])
| |
2495630856bb3b8103a68e112e090569e38012f30dbc6a3269f9bf63f330acb4 | blindglobe/common-lisp-stat | ladata.lsp | ;;; -*- mode: lisp -*-
Copyright ( c ) 2005 - -2008 , by < >
;;; See COPYRIGHT file for any additional restrictions (BSD license).
Since 1991 , ANSI was finally finished . Edited for ANSI Common Lisp .
;;;; ladata -- Data handling functions for linear algebra interface
;;;;
Copyright ( c ) 1991 , by . Pe... | null | https://raw.githubusercontent.com/blindglobe/common-lisp-stat/0c657e10a4ee7e8d4ef3737f8c2d4e62abace2d8/src/numerics/ladata.lsp | lisp | -*- mode: lisp -*-
See COPYRIGHT file for any additional restrictions (BSD license).
ladata -- Data handling functions for linear algebra interface
unrestricted use.
Should we do the same with int's and long's? There is some
evidence that it might be useful?
Data Mode Functions
a... | Copyright ( c ) 2005 - -2008 , by < >
Since 1991 , ANSI was finally finished . Edited for ANSI Common Lisp .
Copyright ( c ) 1991 , by . Permission is granted for
(in-package :lisp-stat-linalg-data)
#+openmcl
(defctype size-t :unsigned-long)
#+sbcl
(defctype size-t :unsigned-int)
These constants n... |
5b26b1c696632917a323012cd0a3b7ea71f3f70384e8c12f3490b0454b0829c4 | input-output-hk/plutus | TypeCheck.hs | -- editorconfig-checker-disable-file
-- | Kind/type inference/checking.
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TypeFamilies #-}
module PlutusCore.TypeCheck
( ToKind
, MonadKindCheck
, MonadTypeCheck
, Typecheckable
-- * Configuration.
, BuiltinTypes (..)
, KindCheckConfig (..)
... | null | https://raw.githubusercontent.com/input-output-hk/plutus/00b2fc41080e544e3e93ac6f1274745100e81dd3/plutus-core/plutus-core/src/PlutusCore/TypeCheck.hs | haskell | editorconfig-checker-disable-file
| Kind/type inference/checking.
# LANGUAGE ConstraintKinds #
# LANGUAGE TypeFamilies #
* Configuration.
* Kind/type inference/checking.
| The constraint for built-in types/functions are kind/type-checkable.
We keep this separate from 'MonadKindCheck'/'MonadTypeCheck', because... |
module PlutusCore.TypeCheck
( ToKind
, MonadKindCheck
, MonadTypeCheck
, Typecheckable
, BuiltinTypes (..)
, KindCheckConfig (..)
, TypeCheckConfig (..)
, tccBuiltinTypes
, defKindCheckConfig
, builtinMeaningsToTypes
, getDefTypeCheckConfig
, inferKind
, checkKind
... |
79375f61d6663ecca2960c80c47fc23aaa7a75c0e2716b7f5022ba3271c6ba3d | ocaml/oasis-db | Account.ml |
* Account management
@author
@author Sylvain Le Gall
*)
open Context
open OCAAccount
let user_settings_box ~ctxt sp =
OCAWeb.Account.user_settings_box ~ctxt:ctxt.ocaw sp
let new_account_ext ~ctxt sp =
OCAWeb.Account.new_account ~ctxt:ctxt.ocaw sp
let lost_passwd_ext ~ctxt sp =
OCAWeb.Acco... | null | https://raw.githubusercontent.com/ocaml/oasis-db/f8b19d431102b5c5b7dced00a5242a5366ad263f/src/web/Account.ml | ocaml |
* Account management
@author
@author Sylvain Le Gall
*)
open Context
open OCAAccount
let user_settings_box ~ctxt sp =
OCAWeb.Account.user_settings_box ~ctxt:ctxt.ocaw sp
let new_account_ext ~ctxt sp =
OCAWeb.Account.new_account ~ctxt:ctxt.ocaw sp
let lost_passwd_ext ~ctxt sp =
OCAWeb.Acco... | |
866378943e9464899201c8324787c3e056c54adae8e5f9225e079144ad97e6fb | chefy-io/clojure-katas | arranged_prob_test.clj | (ns clojure-katas.arranged-prob-test
(:use clojure.test
clojure-katas.arranged-prob))
original source : Euler problem 100
(deftest arranged-prob-test
(testing "conditional probability"
100 total chips , 50 blue chips
what is the probability of drawing 2 blue chips in a row ?
(is (= (float 0.2474... | null | https://raw.githubusercontent.com/chefy-io/clojure-katas/81efe02dfe5add9e10146e10dd2b34f072f7686e/test/clojure_katas/arranged_prob_test.clj | clojure | (ns clojure-katas.arranged-prob-test
(:use clojure.test
clojure-katas.arranged-prob))
original source : Euler problem 100
(deftest arranged-prob-test
(testing "conditional probability"
100 total chips , 50 blue chips
what is the probability of drawing 2 blue chips in a row ?
(is (= (float 0.2474... | |
eaf63f3b40657ea3cd381209f3f74b565d6b9afd1913bce0d63df3a19cf6d461 | BillHallahan/G2 | Queen.hs | {-@ LIQUID "--no-termination" @-}
module Queen (main) where
@ type TRUE = { v : | v } @
{-@ die :: {v:String | false} -> a @-}
die str = error str
assertIO :: Bool -> IO ()
assertIO True = return ()
assertIO _ = die "violated assert"
{-@ assert :: TRUE -> a -> a @-}
assert :: Bool -> a -> a
assert True x = x
asse... | null | https://raw.githubusercontent.com/BillHallahan/G2/e2b99d2918a28eee81edac26fa4ba423abf2ebda/tests/LiquidInf/Paper/Eval/Sato/Queen.hs | haskell | @ LIQUID "--no-termination" @
@ die :: {v:String | false} -> a @
@ assert :: TRUE -> a -> a @ |
module Queen (main) where
@ type TRUE = { v : | v } @
die str = error str
assertIO :: Bool -> IO ()
assertIO True = return ()
assertIO _ = die "violated assert"
assert :: Bool -> a -> a
assert True x = x
assert _ _ = die "violated assert"
dotsPrint :: Int -> IO ()
dotsPrint n = if n == 0 then return () else do p... |
212eb9027fe3367dc56451a3e9eaedfc9f118df2773c05d5c37650f9fbb00363 | ocaml-flambda/flambda-backend | main_args.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/flambda-backend/b56f75153bf58046bfa1eebd9d76e41026bfc3e0/ocaml/driver/main_args.ml | ocaml | ************************************************************************
OCaml
... | , projet Para , INRIA Rocquencourt
Copyright 1998 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
let mk_a f =
"-a", Arg.Unit f, " Build a library"
;;
let mk_alert f =
"-alert", Arg.String f,
Printf... |
db4b5a3a3d05023e47606ff00b9d755878113612162b8a95a592bb662dd7db3f | aryx/xix | parse_asm5.mli |
will call internally first
val parse:
(Preprocessor.cmdline_defs * Preprocessor.include_paths)-> Common.filename ->
Ast_asm5.program
val parse_no_cpp: Common.filename -> Ast_asm5.program
| null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/assembler/parse_asm5.mli | ocaml |
will call internally first
val parse:
(Preprocessor.cmdline_defs * Preprocessor.include_paths)-> Common.filename ->
Ast_asm5.program
val parse_no_cpp: Common.filename -> Ast_asm5.program
| |
9fb1d7864ccf08235d999afe52310b29cc9e83d9fbc0389dd77c42b6c02957b7 | igorhvr/bedlam | scheme.scm | ; Various Scheme evaluating/printing plugins
(import threading)
(import debugging)
(define (pprint channel message ignore term)
(with-input-from-string term
(lambda ()
(let loop ([x (read)] [l #f])
(if (eof-object? x)
(and l (safe-pp-to-string l))
(loop (read) x))))))
(defin... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/sisc/sisc-contrib/irc/scheme/sarah/plugins/scheme.scm | scheme | Various Scheme evaluating/printing plugins
An error? Egads!
(putprop 'resume env (make-resume e))
Start the threads | (import threading)
(import debugging)
(define (pprint channel message ignore term)
(with-input-from-string term
(lambda ()
(let loop ([x (read)] [l #f])
(if (eof-object? x)
(and l (safe-pp-to-string l))
(loop (read) x))))))
(define (expand channel message ignore expr)
(wit... |
737a521e52bc580261d3bb428f613ab440b546f652ec27f78121364c3192e420 | mbillingr/lisp-in-small-pieces | sandbox.scm | (import (libs book)
(libs utils))
(include "../09-macros/evaluator.scm")
(include "10-02-code-walking.scm")
(include "10-03-boxes.scm")
(include "10-04-lambda-lifting.scm")
(include "10-05-extract.scm")
(include "10-06-gather-vars.scm")
(include "10-08-generating-c.scm")
(define (create-compiler old-level)
... | null | https://raw.githubusercontent.com/mbillingr/lisp-in-small-pieces/b2b158dfa91dc95d75af4bd7d93f8df22219047e/10-to-c/sandbox.scm | scheme | (sg sg.predef))
(enrich-with-new-global-variables! level)
Create resulting evaluator instance
Enrich environment with eval
(let ((eval-var (make-Predefined-Variable
(set! sg (sr-extend sg eval-var eval-fn)))
Mark the beginning of the global environment
(set-Evaluator-RunTime-Environment!
level (mark-global-runtime... | (import (libs book)
(libs utils))
(include "../09-macros/evaluator.scm")
(include "10-02-code-walking.scm")
(include "10-03-boxes.scm")
(include "10-04-lambda-lifting.scm")
(include "10-05-extract.scm")
(include "10-06-gather-vars.scm")
(include "10-08-generating-c.scm")
(define (create-compiler old-level)
... |
6622dd5758c61c6f216a060fb1208c6fb4f02956bb703f8007db0b9ba5453f7e | Nayshins/ocaml-tic-tac-toe | util.ml | open Core.Std
let set_nth of_list index element =
let array_of_list = Array.of_list of_list in
Array.set array_of_list index element;
Array.to_list array_of_list
| null | https://raw.githubusercontent.com/Nayshins/ocaml-tic-tac-toe/a177feed4938552ce7df79f0e4d09b24cdcb3667/src/util.ml | ocaml | open Core.Std
let set_nth of_list index element =
let array_of_list = Array.of_list of_list in
Array.set array_of_list index element;
Array.to_list array_of_list
| |
7a5e02cf4b48c8854215fe4169dd348fae540bd5c59a8463aa7febbb81d91d5c | gebi/jungerl | gettext_sup.erl | %%%----------------------------------------------------------------------
File : gettext_sup.erl
%%% Author :
%%% Purpose : Supervisor for the gettext handling
Created : 28 Oct 2003
%%%
$ Id$
%%%----------------------------------------------------------------------
-module(gettext_sup).
-behaviour(supervis... | null | https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/gettext/src/gettext_sup.erl | erlang | ----------------------------------------------------------------------
Author :
Purpose : Supervisor for the gettext handling
----------------------------------------------------------------------
External exports
supervisor callbacks
----------------------------------------------------------------------
API
--... | File : gettext_sup.erl
Created : 28 Oct 2003
$ Id$
-module(gettext_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
start_link() ->
supervisor:start_link({local, gettext_sup}, gettext_sup, []).
Returns : { ok , { SupFlags , [ ChildSpec ] } } |
init([]) ->
GettextSe... |
0c68a25f7252e8be7cfdce07079f3931c667457d213602057e0c8d912620f939 | hyperthunk/hamcrest-erlang | hamcrest_transform_SUITE.erl | %% -----------------------------------------------------------------------------
%%
.
%%
Copyright ( c ) 2017 ( )
%%
%% 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 restric... | null | https://raw.githubusercontent.com/hyperthunk/hamcrest-erlang/0766ea004f7dd900c36b06aff14dbbac1d03b425/test/hamcrest_transform_SUITE.erl | erlang | -----------------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furni... | .
Copyright ( c ) 2017 ( )
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRES... |
97f093e058e10405b0769535d55e7525de90c39017c92a28235614eb54ec8135 | kit-ty-kate/visitors | monomorphic.ml | type 'a t =
| Leaf of 'a
| Node of 'a t * ('a * 'a) t
[@@deriving visitors { variety = "map"; monomorphic = ["'env"] }]
let o = object
inherit [_] map
method! visit_Leaf visit_'a env x =
let env = (env : int) in (* check that ['env] is not quantified *)
Leaf (visit_'a env x)
end
| null | https://raw.githubusercontent.com/kit-ty-kate/visitors/fc53cc486178781e0b1e581eced98e07facb7d29/test/monomorphic.ml | ocaml | check that ['env] is not quantified | type 'a t =
| Leaf of 'a
| Node of 'a t * ('a * 'a) t
[@@deriving visitors { variety = "map"; monomorphic = ["'env"] }]
let o = object
inherit [_] map
method! visit_Leaf visit_'a env x =
Leaf (visit_'a env x)
end
|
e28576b9998424922eafe227c102e005061fdfb88420662667d2ba6f9b0cc386 | theodormoroianu/SecondYearCourses | HaskellChurch_20210415163756.hs | {-# LANGUAGE RankNTypes #-}
module HaskellChurch where
A boolean is any way to choose between two alternatives
newtype CBool = CBool {cIf :: forall t. t -> t -> t}
An instance to show as regular Booleans
instance Show CBool where
show b = "cBool " <> show (cIf b True False)
The boolean constant true always ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/HaskellChurch_20210415163756.hs | haskell | # LANGUAGE RankNTypes #
The boolean negation switches the alternatives
The boolean conjunction can be built as a conditional
The boolean disjunction can be built as a conditional
a pair is a way to compute something based on the values
contained within the pair.
a function to be applied on the values, it will apply i... | module HaskellChurch where
A boolean is any way to choose between two alternatives
newtype CBool = CBool {cIf :: forall t. t -> t -> t}
An instance to show as regular Booleans
instance Show CBool where
show b = "cBool " <> show (cIf b True False)
The boolean constant true always chooses the first alternativ... |
3ece6ef7c646d3af4ee28d7099fa8da91ff29c903f608bdacde8f07c3dc826a7 | rabbitmq/rabbitmq-auth-backend-oauth2 | rabbit_oauth2_scope.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(rabbit_oauth2_scope).
-export([vhost_acc... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-auth-backend-oauth2/444174bba60eba307c0ee5ede51cb4a2fb99034f/src/rabbit_oauth2_scope.erl | erlang |
API functions -------------------------------------------------------------- | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
-module(rabbit_oauth2_scope).
-export([vhost_access/2,... |
3e6235f6e5a1a42122f8da7b56eb28068881aab73fb4074aec120f4cb48ad00a | BoeingX/haskell-programming-from-first-principles | CiphersSpec.hs | module AlgebraicDataTypes.ChapterExercises.CiphersSpec where
import Test.Hspec
import AlgebraicDataTypes.ChapterExercises.Ciphers
spec :: Spec
spec = do
describe "Test calculateCompanion" $ do
it "message=MEET AT DAWN and keyword=ALLY" $ do
calculateCompanion "MEET AT DAWN" "ALLY" `shouldBe` "... | null | https://raw.githubusercontent.com/BoeingX/haskell-programming-from-first-principles/ffb637f536597f552a4e4567fee848ed27f3ba74/test/AlgebraicDataTypes/ChapterExercises/CiphersSpec.hs | haskell | module AlgebraicDataTypes.ChapterExercises.CiphersSpec where
import Test.Hspec
import AlgebraicDataTypes.ChapterExercises.Ciphers
spec :: Spec
spec = do
describe "Test calculateCompanion" $ do
it "message=MEET AT DAWN and keyword=ALLY" $ do
calculateCompanion "MEET AT DAWN" "ALLY" `shouldBe` "... | |
2349f5ac53c3a8e1ddbf0668bc34aaa986c050037ae7a67cafaff724834b566f | sbcl/sbcl | slots.lisp | This software is part of the SBCL system . See the README file for
;;;; more information.
This software is derived from software originally released by Xerox
;;;; Corporation. Copyright and release statements follow. Later modifications
;;;; to the software are in the public domain and are provided with
;;;; absol... | null | https://raw.githubusercontent.com/sbcl/sbcl/cacbb24d03cbc1309447bfcd72a5cd17dd2d0e8b/src/pcl/slots.lisp | lisp | more information.
Corporation. Copyright and release statements follow. Later modifications
to the software are in the public domain and are provided with
absolutely no warranty. See the COPYING and CREDITS files for more
information.
All rights reserved.
Use and copying of this software and preparation of der... | This software is part of the SBCL system . See the README file for
This software is derived from software originally released by Xerox
copyright information from original PCL sources :
Copyright ( c ) 1985 , 1986 , 1987 , 1988 , 1989 , 1990 Xerox Corporation .
derivative works must comply with all applicabl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.