Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

User-friendliness is what really matters

Name: Anonymous 2009-02-27 15:55

on space_check(threshold_percentage)
    tell application "Finder"
        set the percent_free to ¬
            (((the free space of the startup disk) / ¬
                (the capacity of the startup disk)) * 100) div 1
    end tell
    if the percent_free is less than the threshold_percentage then
        tell application (path to frontmost application as text)
            display dialog "The startup disk has only " & the percent_free & ¬
                " percent of its capacity available." & return & return & ¬
                "Should this script continue?" with icon 1
        end tell
    end if
end space_check

Name: Anonymous 2009-02-27 19:07

>>6
I've seen this before, and it's still a bit confusing. I know how it works with the list functor instance, but what about others, like IO, State, and such?

It looks almost comonadic. Is it a dual of some monadic function, perhaps?

Name: >>9 2009-02-27 19:55

Never mind, I found out. It's similar to cfix :: w (w a -> a) -> a, which is the dual of mfix :: (a -> m a) -> m a.

<http://blog.sigfpe.com/2007/02/comonads-and-reading-from-future.html>;

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List