Loading ...
Sorry, an error occurred while loading the content.

Re: [extremeperl] Book: Higher Order Perl

Expand Messages
  • Terrence Brannon
    ... I did but a function is a small clear statement about how input(s) transform into output reliably, time after time, without fail and without intermediate
    Message 1 of 58 , Mar 30, 2005
    • 0 Attachment
      chromatic <chromatic@...> writes:

      > On Tue, 2005-03-29 at 12:57 +0000, Terrence Brannon wrote:
      >
      >> In a strongly typed functional language, reasoning by proof gives you
      >> 100% _certainty_ that a certain function works for all input. There is
      >> no need to test.
      >
      > Surely you left off the disclaimer that you have defined the function
      > correctly

      I did but a function is a small clear statement about how input(s)
      transform into output reliably, time after time, without fail and
      without intermediate state.

      > -- or does your typechecker magically reason that a square
      > root function that takes an integer may sometimes return an irrational
      > number?

      1/ You really should take a look at the Maybe monad in Haskell
      sometimes. It addresses a lot of issues that Perl programmers run into
      when chaining together methods where a method in the middle might
      return something to break the chain. The "may sometimes" in your
      sentence above is a well-typed strategy of computation in Haskell. It
      is a collection of if-thens, try-throw-catches in Perl and other
      languages.

      2/ The haskell sqrt function takes a datum of typing Floating and returns
      a datum of the same:

      terry@Abulafia:~$ ghci
      ___ ___ _
      / _ \ /\ /\/ __(_)
      / /_\// /_/ / / | | GHC Interactive, version 6.2.2, for Haskell 98.
      / /_\\/ __ / /___| | http://www.haskell.org/ghc/
      \____/\/ /_/\____/|_| Type :? for help.

      Loading package base ... linking ... done.
      Prelude> :type sqrt
      sqrt :: forall a. (Floating a) => a -> a
      Prelude>

      --
      Carter's Compass: I know I'm on the right track when,
      by deleting something, I'm adding functionality.
    • Tom Vilot
      ... Wait. That sounds like Rob .... ;c) (kidding) ... Wait. That *also* sounds like Rob ... ... (not kidding!)
      Message 58 of 58 , Apr 8 9:37 AM
      • 0 Attachment
        Greg C wrote:

        >
        >
        > Consider: projects A and B have identical goals. In project A, you
        > have free
        > rein in your choice of software and hardware tools. However, the
        > manager sets
        > arbitrary deadlines, likes to stand behind people and criticize their
        > code as
        > they type,


        Wait. That sounds like Rob ....
        ;c) (kidding)

        > On project B, the choice of langauge and hardware are made for you and
        > there's
        > only one computer per two programmers. On the other hand, the manager
        > sees his
        > people as people, negotiates requirements and schedules on a realistic
        > basis,
        > trusts his people, follows a set of best practices (be it XP or some
        > other) and
        > chases everyone out of the office at 5:30.


        Wait. That *also* sounds like Rob ...

        :c)

        (not kidding!)
      Your message has been successfully submitted and would be delivered to recipients shortly.