Right now it's my favorite language. It's actually practical and fast (unlike Haskell). Also I can use imperative style whenever I feel like it but I still have all of the goodness from using a functional language. I am starting to use it as my regular language.
Name:
Anonymous2011-07-22 2:55
Try Prolog.
Name:
Anonymous2011-07-22 3:12
It has normal I/O compared to Haskell's monads so it has more use for practical appliations
>>7
Yes, however the floating-point numbers boxing used by OCaml's reference implementation is terrible.
Name:
Anonymous2011-07-22 9:24
>>8
True that. Every float is individually allocated in the heap, I think. Though you can use the Bigarray module is you are using floats a lot. It puts floats adjacent to each other in memory just like C.
Name:
Anonymous2011-07-22 9:28
>>5
I've been thinking of using SML too. It looks cleaner (in that it doesn't have objects and has a standard, so there are no weirdness etc) but OCaml is just more popular. It has many more libraries. I use Lapack somewhat often which OCaml interfaces, so there's that too.
>>14
no, see bloatezd beacuse o bapds no touhoujews an subnormals vuiagea
Name:
Anonymous2011-07-22 15:54
>>11
It's a Turing complete programming language... what can't you do with it?
But seriously, I am just starting out with it. Right now I have an implementation of a Kd-tree, and some other image processing stuff like filters and so on. Also a bunch of triangle mesh functions.
>>12
It was annoying when I started but I got kind of used to it. Also, it actually helped me lot because it caught a lots of potential bugs at compile time where I switched integers and floats.
>>7
WTF are you talking about? Haskell's Float is single precision floating number and Double is double precision. There's no built-in floating point type with unlimited precision.
>>7
WTF are you talking about? Haskell's Float is single precision floating number and Double is double precision. There's no built-in floating point type with unlimited precision.
Name:
Anonymous2011-07-22 21:08
>>20
Haskell's integers are unlimited precision. I think he is talking about that. Though really Haskell has both types of integers but it's not immediately obvious because of type classes.
>>21
There's no way in hell to confuse Int and Integer. I don't see how the fact that they are both instances of Integral class (and many others) confuses the things in any way. They are still two distinct types that cannot be used together.
Or do you confuse IO and Maybe? They are both monads after all...
It's not that much of a stretch to confuse Int and Integer. Anyway the point is that Haskell uses Integer by default. You have to specify if you want to use Int.
Anyway the point is that Haskell uses Integer by default.
No.
Name:
Anonymous2011-07-23 19:42
Monad is just one of typeclasses. And a typeclass is some abstract entity, that allows concrete types to use some functions. And the nature of these functions depends on a typeclass of a concrete type, and how these functions implemented for a concrete type depends on the embodiment of the typeclass of that type. For example, monad Maybe is a type, computations, embedded into a monad of which, return either result, embedded into one of its data constructors, or a second data constructor - Nothing. Naturally, abstract types are often implemented in terms of type-class constrained polytypes and extraction functions from/to the abstract type families of polymorphic functions to/from some concrete type. However, the definitional structure of an abstract type uses interface operators and, therefore, is not affected by changes of representation. which may be logically hidden and, sometimes, even physically unavailable.
Name:
Anonymous2011-07-23 19:54
>>25
Great explanation, thank you for clearing that up for us. You might have to keep this one on the Blog for future reference.
Name:
Anonymous2011-07-23 19:58
>>24
Meanwhile in ghci...
Prelude> let a = 3
Prelude> :t a
a :: Integer
So yeah, it uses Integer by default.
Name:
Anonymous2011-07-24 13:53
>>11
Ocaml (and SML) has an excellent module system and it has functors. Functors are basically functions that map modules to modules.
So let's say you want to create a Set data structure for any type. Elements of the data structure would have to be ordered. Ordering can be done using a compare function for that particular type. So first you would create a module for a certain type (say int) with a signature:
module type OrderedType = sig
type t
val compare : t -> t -> int
end
and then you can create the Set functor which reads in a module like
module OrdInt : OrderedType = struct
type t = int
let compare a b = if a < b ... blah bla
of type OrderedType and outputs a Set module that have elements of type int.
The Set functor would look something like
module Set = functor (Ord : OrderedType) -> struct
type elt = Ord.t
type set = [elt]
let empty a = (a = [])
let member xs x = ... blah blah
end
and you can then create sets of ints like
module IntSet = Set(OrdInt)
So in the end you can create your own data structure d and create d sets. Then use the Set datastructure without having to pass the compare function all the time.
Name:
Anonymous2011-07-24 14:16
>>28
C/C++ has an excellent module system and it has functors. Functors are basically functions that map modules to modules.
It can be proved that the cardinality of the real numbers is greater than that of the natural numbers just described. This can be visualized using Cantor's diagonal argument; classic questions of cardinality (for instance the continuum hypothesis) are concerned with discovering whether there is some cardinal between some pair of other infinite cardinals. In more recent times mathematicians have been describing the properties of larger and larger cardinals.
Name:
Anonymous2013-08-31 23:46
The Indian mathematical text Surya Prajnapti (c. 3rd–4th century BCE) classifies all numbers into three sets: enumerable, innumerable, and infinite. Each of these was further subdivided into three orders:
Name:
Anonymous2013-09-01 0:31
The IEEE floating-point standard (IEEE 754) specifies the positive and negative infinity values. These are defined as the result of arithmetic overflow, division by zero, and other exceptional operations.
Name:
Anonymous2013-09-01 1:17
For example, properties of the natural and real numbers can be derived within set theory, as each number system can be identified with a set of equivalence classes under a suitable equivalence relation whose field is some infinite set.
Name:
Anonymous2013-09-01 2:02
Although originally controversial, the axiom of choice is now used without reservation by most mathematicians, and it is included in Zermelo–Fraenkel set theory with the axiom of choice (ZFC), the standard form of axiomatic set theory.
Name:
Anonymous2013-09-01 2:47
The status of the axiom of choice varies between different varieties of constructive mathematics.