deniok: (pic#)

По ходу перевода Gentle Introduction to Haskell http://www.rsdn.ru/article/mag/200604/haskell_part1.xml (половина опубликована в RSDN Magazine №4 2006, полностью выложат в открытый доступ спустя какое-то время) нашёл там некоторое количество опечаток. Выкладываю список здесь для пинания, после пинания думаю послать на haskell.org, чтоб поправили.

1. http://www.haskell.org/tutorial/goodies.html#sect2.1 последний абзац:

An expression's or function's principal type is the least general type that, intuitively, "contains all instances of the expression". For example, the principal type of head is [a]->a; [b]->a, a->a, or even a are correct types, but too general, whereas something like [Integer]->Integer is too specific.


Наверное, b->a.


2. http://www.haskell.org/tutorial/stdclasses.html#sect8.4 последний абзац:

Derived Read (Show) instances are possible for all types whose component types also have Read (Show) instances. (Read and Show instances for most of the standard types are provided by the Prelude. Some types, such as the function type (->), have a Show instance but not a corresponding Read.)

В Prelude нет Show instance для функционального типа. Где-то в библиотеках вроде есть заглушка, но в стандарте

http://haskell.org/onlinereport/basic.html#sect6.3.3 сказано :


All Prelude types, except function types and IO types, are instances of Show and Read. (If desired, a programmer can easily make functions and IO types into (vacuous) instances of Show, by providing an instance declaration.)


3. http://www.haskell.org/tutorial/monads.html#sect9.3 в двух местах (ближе к концу и в последнем абзаце)


We're now ready to actually run some programs. This function runs a program in M given a maximum number of computation steps:


run :: Resource -> R a -> Maybe a

 

и

 

We could also embed this monad inside the standard IO monad, allowing computations in M to interact with the outside world.


Никакого типа M нигде не вводилось. Имеется ввиду тип R. 



4. http://www.haskell.org/tutorial/arrays.html#sect13.3 первый же тип 


accumArray :: (Ix a) -> (b -> c -> b) -> b -> (a,a) -> [Assoc a c] -> Array a b

Не вводился никакой Assoc и контекст под ->. Надо так


accumArray :: (Ix a) => (b->c->b) -> b -> (a,a) -> [(a,c)] -> Array a b


Profile

deniok: (Default)
deniok

February 2022

S M T W T F S
  12345
6789101112
13141516171819
20212223 242526
2728     

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 23rd, 2025 03:48 pm
Powered by Dreamwidth Studios