EnglishFrenchSpanish

OnWorks favicon

ffihugs - Online in the Cloud

Run ffihugs in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command ffihugs that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


hugs, runhugs, ffihugs - Hugs 98, functional programming system

SYNOPSIS


hugs [ options ] [ modules ]
runhugs [ options ] module [ args ]
ffihugs [ options ] module [ compiler_argument ] ...

DESCRIPTION


Hugs is an interpreter for Haskell, a standard non-strict functional programming language.
Hugs implements almost all of the Haskell 98 standard, except for mutually recursive
modules. The name Hugs is a mnemonic for the Haskell User's Gofer System.

The interpreter is started using the hugs command. After processing options, it loads the
standard module Prelude and any other modules listed on the command line.

Each Haskell module is stored in a separate file. When loading a module name, Hugs
replaces each `.' in name with a `/' and looks in each of the directories on its search
path (see -P under OPTIONS) for the files name.hs and name.lhs. (The recognized suffixes
may be changed using the -S option, described under OPTIONS.) It also tries name as a
literal filename. Files ending in ".lhs" are treated as literate scripts.

OPTIONS


Some options are toggled with + or - to turn them on or off, respectively.

Language conformance
+98 Accept only Haskell 98 (cannot be changed within Hugs; default: on). Turning this
off enables several special Hugs extensions, which are described in the Hugs 98
User Manual.

+o Allow overlapping instances (a Hugs extension; default: off)

+O Allow unsafe overlapping instances (a Hugs extension; default: off)

+H Allow `here documents' (a Hugs extension; default: off)

Module loading
+l Treat files whose names end in neither `.hs' nor `.lhs' as literate scripts
(default: off)

+. Print dots to show progress while loading modules (default: off)

+q Print nothing to show progress while loading modules (default: on)

+w Always show which files are loaded (default: off)

Expression evaluation
+s Print number of reductions/cells after each evaluation (default: off)

+t Print type after each evaluation (default: off)

+T Apply the Haskell defaulting rules before printing types (default: off)

+g Print number of cells recovered after each garbage collection (default: off)

+Q Qualify names when printing (default: off)

+k Show kind errors in full (default: off)

+u Use "show" to display results (default: on)

+I Display results of IO programs (default: off)

Parameters
Other options (in which - could be replaced by +, the choice making no difference) are:

-hnum Set heap size (cannot be changed within Hugs; default: 250K)

-pstr Set prompt string to str (default: `%s> '). Any %s in the prompt will be replaced
by the current module name.

-rstr Set repeat last expression string to str (default: $$).

-Pstr Set search path for source files to str, which should be a colon-separated list of
directories. A null entry in this list will be replaced by the previous search
path; a null str means the default path. Any occurrence of {Hugs} in this string
is expanded to the Hugs library directory, namely /usr/lib/hugs. Similarly, {Home}
is expanded to your home directory (the value of the HOME environment variable).
An entry of the form `directory/*' means all the immediate subdirectories of
directory. The default value is

.:{Home}/lib/hugs/packages/*:/usr/local/lib/hugs/packages/*:{Hugs}/packages/*:{Hugs}/libraries

-Sstr Set the colon-separated list of source file suffixes to str (default: .hs:.lhs). A
null entry in this list will be replaced by the previous suffix list; a null str
means the default list.

-Estr Use editor setting given by str (default: the value of the EDITOR environment
variable). Any occurrences of %d and %s in the editor option are replaced by the
start line number and the name of the file to be edited, respectively. A common
setting is "vi +%d %s".

-cnum Set constraint cutoff limit in the type checker to num (default: 40).

-Fcmd Set preprocessor filter for source files to cmd (unset by default). Instead of
reading a source file directly, Hugs will read the standard output of cmd run with
the source file name as argument.

-Xstr The string str is interpreted as an option string. This is useful, for example,
for passing multiple arguments to runhugs in a #! script.

COMMANDS


Once the interpreter has been loaded, the following commands are available:

:load [modules] clear all modules except the prelude, and load the specified modules.

:also modules read additional modules.

:reload repeat last load command.

:edit file edit file.

:edit edit last file.

:module module set module for evaluating expressions.

expr evaluate expression.

:type expr print type of expression.

:? display this list of commands.

:set options set command line options.

:set help on command line options.

:names [patterns] list names currently in scope matching any of the shell-style patterns.

:info names describe named objects.

:browse modules browse names exported by modules.

:find name edit file containing definition of name.

:!command shell escape.

:cd dir change directory.

:gc force garbage collection.

:version print Hugs version.

:quit exit Hugs interpreter.

Any command may be abbreviated to :c where c is the first character in the full name. On
most systems, you can also exit from Hugs by typing the end-of-file character (^D).

Note that the interrupt key (^C on most systems) can be used at any time whilst using
Hugs to abandon the process of reading in a file of function definitions or the
evaluation of an expression. When the interrupt is detected, Hugs prints the string
"{Interrupted!}" and prints the prompt so that further commands can be entered.

STANDALONE PROGRAMS


The runhugs command is an interpreter for an executable Hugs script, which must contain a
Haskell Main module. For example, the executable file hello might contain the lines

#!/usr/bin/runhugs +l

> module Main where
> main = putStr "Hello, World\n"

When this file is executed, runhugs will invoke the main function. Any arguments given on
the command line will be available through getArgs.

Note that #! passes only one orgument to the script. The -X option may be used to get
around this.

C INTERFACE


On architectures that support dynamic linking, Hugs implements the part of the Haskell 98
Foreign Function Interface (FFI) that allows Haskell functions to call C routines. (On
the x86, PowerPC and Sparc architectures, all foreign imports are supported; on others,
only static imports are provided.) Modules containing such foreign declarations must be
compiled using the ffihugs command before use with hugs. Additional arguments for the C
compiler may be supplied via compiler_arguments. For example, suppose you have some C
functions in test.c and some FFI declarations for those functions in Test.hs and the code
in test.c needs to be compiled with -lm. Then you would compile the module with the
command

ffihugs Test.hs test.c -lm

which generates an object file Test.so. Then when hugs loads Test.hs, it will also load
Test.so.

In the standard FFI, each foreign import declaration should name a C header file
containing the prototype of the function. Because this is often cumbersome, ffihugs
provides the following additional option:

-istr Specify an include for the generated C file. The include string should be
something that can follow "#include" in a C program, as in

ffihugs '-i<math.h>' '-i"mydefs.h"' Test.hs test.c -lm

ENVIRONMENT


HUGSFLAGS
Additional options for hugs, processed before any given on the command line.

HUGSDIR
The Hugs library directory (default: /usr/lib/hugs).

EDITOR The default editor, if -E is not given.

SHELL Used to specify the shell that is invoked by the :! command.

Use ffihugs online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    KDiff3
    KDiff3
    This repository is no longer maintained
    and is kept for archival purposes. See
    https://invent.kde.org/sdk/kdiff3 for
    the newest code and
    https://download.kde.o...
    Download KDiff3
  • 2
    USBLoaderGX
    USBLoaderGX
    USBLoaderGX is a GUI for
    Waninkoko's USB Loader, based on
    libwiigui. It allows listing and
    launching Wii games, Gamecube games and
    homebrew on Wii and WiiU...
    Download USBLoaderGX
  • 3
    Firebird
    Firebird
    Firebird RDBMS offers ANSI SQL features
    & runs on Linux, Windows &
    several Unix platforms. Features
    excellent concurrency & performance
    & power...
    Download Firebird
  • 4
    KompoZer
    KompoZer
    KompoZer is a wysiwyg HTML editor using
    the Mozilla Composer codebase. As
    Nvu's development has been stopped
    in 2005, KompoZer fixes many bugs and
    adds a f...
    Download KompoZer
  • 5
    Free Manga Downloader
    Free Manga Downloader
    The Free Manga Downloader (FMD) is an
    open source application written in
    Object-Pascal for managing and
    downloading manga from various websites.
    This is a mirr...
    Download Free Manga Downloader
  • 6
    UNetbootin
    UNetbootin
    UNetbootin allows you to create bootable
    Live USB drives for Ubuntu, Fedora, and
    other Linux distributions without
    burning a CD. It runs on Windows, Linux,
    and ...
    Download UNetbootin
  • More »

Linux commands

  • 1
    abc2abc
    abc2abc
    abc2abc - a simple abc
    checker/re-formatter/transposer ...
    Run abc2abc
  • 2
    abc2ly
    abc2ly
    abc2ly - manual page for abc2ly
    (LilyPond) 2.18.2 ...
    Run abc2ly
  • 3
    coqdoc
    coqdoc
    coqdoc - A documentation tool for the
    Coq proof assistant ...
    Run coqdoc
  • 4
    coqide
    coqide
    coqide - The Coq Proof Assistant
    graphical interface ...
    Run coqide
  • 5
    g.gui.vdigitgrass
    g.gui.vdigitgrass
    g.gui.vdigit - Interactive editing and
    digitization of vector maps. KEYWORDS:
    general, user interface, GUI, vector,
    editing, digitizer ...
    Run g.gui.vdigitgrass
  • 6
    g.listgrass
    g.listgrass
    g.list - Lists available GRASS data
    base files of the user-specified data
    type optionally using the search
    pattern. KEYWORDS: general, map
    management, list ...
    Run g.listgrass
  • More »

Ad