Questions tagged [clean-language]

Clean is a general purpose, purely functional, lazy programming language.

Clean is a general purpose, state-of-the-art, pure and lazy functional programming language designed for making real-world applications. The language Clean first appeared in 1987.

Some of its most notable language features are uniqueness typing, dynamic typing, and generic functions.

It was one of the inspirations of the programming language.

Homepage

Wikipedia article

18 questions
20
votes
1 answer

How do Rust's ownership semantics relate to uniqueness typing as found in Clean and Mercury?

I noticed that in Rust moving is applied to lvalues, and it's statically enforced that moved-from objects are not used. How do these semantics relate to uniqueness typing as found in Clean and Mercury? Are they the same concept? If not, how do they…
user1804599
11
votes
6 answers

The Clean programming language in the real world?

Are there any real world applications written in the Clean programming language? Either open source or proprietary.
anonymous
3
votes
1 answer

How to list the files of a directory in Clean

I need to list all files of a directory using the Clean programming language, but I don't know any function to do so. Can someone help me?
Guilherme
  • 159
  • 1
  • 7
3
votes
2 answers

Is it feasible to implement a Clean backend with LLVM

Would it be feasible to implement a backend for Clean using the LLVM toolkit? If not, what are the stumbling blocks? Also, if you happened to know of a good reference for the "ABC assembler" used as an IR by the Clean compiler, please include it in…
brooks94
  • 3,836
  • 4
  • 30
  • 57
2
votes
1 answer

List comprehensions (ZF-expressions) with zero qualifiers

List comprehensions (or ZF-expressions) include a sequence of qualifiers, which can be generators or Boolean-valued expressions ("filter expressions") acting as guards. A list comprehension with no qualifier – for instance, [1 | ] – is (apparently)…
Antonielly
  • 71
  • 1
  • 4
2
votes
1 answer

N-Queens example program strange output

I try the code from the squeen.icl example. When I try it with BoardSize :== 11, there is no problem. But when I change it to 12, the output is [. Why? How to fix that? module squeen import StdEnv BoardSize :== 12 Queens::Int [Int] [[Int]] ->…
sa ma
  • 135
  • 7
2
votes
2 answers

Split string to a list of strings in Clean

Because of the limited amount of resources, I need to propose a question here. I have been struggling with functional programming, the endless Haskell tutorials don't really help me. So what I want to achieve, in Clean language, is to split a string…
Gergo Szucs
  • 105
  • 1
  • 12
1
vote
1 answer

Clean language: append number in end of file, fwritei doesn't work

I'm trying to write function that receive [String] which are names of files, String which is the name of the files directory and *f. The function will append to each file an integer in the end. Here is what I got so far: import StdEnv import…
Z E Nir
  • 332
  • 1
  • 2
  • 15
1
vote
0 answers

Clean language: read the content of text file to list of lines. Is it possible to avoid Uniqueness?

Assuming I have *File that I want to read its whole content, and store each line as different element in a list. My intuitive solution was: first (x,y) = x readFile:: *File -> [{#Char}] readFile file | first (fend (file)) = [] |…
Z E Nir
  • 332
  • 1
  • 2
  • 15
1
vote
1 answer

Clean3.0 get directory contents

I am using Cleanide for Clean3.0 programming language. What I am trying to do is to implement a function that receive name of a directory in my system, and return a list of all the files in that directory. I don't know if the defintion of such…
Z E Nir
  • 332
  • 1
  • 2
  • 15
1
vote
1 answer

How is it possible to write a class with two template parameters, where one is a list/array of the other?

I would like to solve this problem in Clean (a language very similar to Haskell): There is a class Node t, with two instances: instance Node EdgeList and instance Node Adjacency. I would like to create a Graph, which is an array or list of…
Iter Ator
  • 8,226
  • 20
  • 73
  • 164
1
vote
2 answers

Modulo function in Clean

Is there a predefined way to compute the modulo of two integers in Clean? StdOverloaded defines the (mod) typeclass, but StdInt does not contain an instance of it, and StdEnv does not either anywhere else. I have seen a language overview about Clean…
1
vote
1 answer

How to split a string on spaces in Clean?

I'm a newbie with functional programming and Clean. I want to split a string on whitespace, like the words function in Haskell. words :: String -> [String] input: "my separated list " output: ["my","separated","list"] This is the definition in…
Thomas
  • 366
  • 6
  • 19
1
vote
1 answer

How to lowercase a string in CLEAN

I have a problem in CLEAN, how can I make lowercase all letter in a string? I can do it through an char array, but i need to do it with a string too. I have the code below so far: module Something import StdEnv, StdLib arrayLower:: [Char] ->…
Thomas
  • 366
  • 6
  • 19
1
vote
1 answer

Concurrent Clean linker error (weird)

Downloaded latest version of "Concurrent Clean" (2.4) for Windows. It installs, the IDE runs. I can compile and run a ridiculously simple program: module blah Start = 1 The problem is, if I make any change at all (for instance Start = 2, or Start…
1
2